7/06/2023

How to Fix the "The file cannot be previewed there is no previewer " Error in Outlook


When you get error message as illustration, you have two solutions can fix this problem.



First, check setting Attachment and Document Previewers.

1. Open Option and select Trust Center.

2. Click Trust Center Settings.... button 

3. Select Attachment Handing

4. If Turn off Attachment Preview check box is enable, please disable it.


6. Click Attachment and Document Previewers button, and enable check box which previewer you need.









If fist solution doesn't work, you have another way. You can modify Windows Registry. But you must be careful when you modify setting.

1. Press Win + R to open the Run dialog.

2. Type regedit command in the text box and click ok.










3. Use the left pane to navigate to HKEY_LOCAL_MACHINE > ​SOFTWARE > ​Microsoft > ​Windows > ​CurrentVersion > ​PreviewHandlers.


4. If you can't find values as below, please add new string value.

{00020827-0000-0000-C000-000000000046} Microsoft Excel previewer
{21E17C2F-AD3A-4b89-841F-09CFE02D16B7} Microsoft Visio previewer
{65235197-874B-4A07-BDC5-E65EA825B718} Microsoft PowerPoint previewer
{84F66100-FF7C-4fb4-B0C0-02CD7FB668FE} Microsoft Word previewer


5. Exit regedit and restart Windows.




8/30/2022

利用Eclipse 安裝4GL 編寫程式

利用Eclipse 安裝4GL 編寫程式

最近工作需要再次接觸工作上Informix 4GL的程式內容。測試多套4GL + FTP服務後還是覺得2016 2018年其間時使用Eclipse 安裝的4GLRemote套件好用。這次撰寫分享安裝過程經驗給各位試試。

首先假設已經有安裝且設定好informix 主機。接下來要下載兩組軟體。

1.       下載舊版 Eclipse 2019-094GL Plug-in 只相容舊版Eclipse

https://www.eclipse.org/downloads/packages/release/2019-09/r/eclipse-ide-eclipse-committers

2.       下載JDK 1.8 版本並安裝好。舊版JDK是為了Eclipse 2019-094GL 套件能正常運作。

  

Eclipse 安裝需要套件步驟有三階段。

·         階段一:Eclipse 安裝與 JDK 1.8 設定。

1.       先安裝好JDK1.8 。再安裝Eclipse 2019-09並開啟完成workspace 設定。


 

更換JDK 版本。Windows / References 檢查 JDK 版本是否為JDK 1.8。若Eclipse 指定到jre 1.8 請記得用add 建立jdk 1.8的目錄。

注意要指定到正確JDK。不是JRE路徑。


·         階段二:4GL Plug in下載與設定

1.       可以連到以下連結瞭解細節。其中包含可以使用Eclipse 版本。

https://marketplace.eclipse.org/content/eclipse-4gl-plug

2.       Marketplace 搜尋4GL Plug-in套件。請在Find欄位輸入步驟一網址。

3.       開始安裝



安裝過程中會詢問安全注意事項。請按Install Anyway


·         階段三:安裝Remote System

1.       Install New Software 找有關remote 的關鍵字


2.       參考下圖勾選六組套件

3.       開始安裝





安裝好後重新開啟
Eclipse


開始測試

1.       參考下圖在IDE右側Icon按下出現Remote System Explorer


2.       IDE左側Perspective建立遠端主機連線。(FTP為例)



3.       主要必須在Host Name輸入遠端ServerIP FQDN。其他欄位說明可以輸入方便辨識的資訊。


4.       啟動連線並輸入帳號與密碼。

 



5.       相關作業完成後就可以看到並編輯遠端主機上4GL 程式。



8/07/2022

使用Excel vlookup 基本操作

 

 

使用vlookup 查找函數提供精準及模糊比對方式。

語法如下:

VLOOKUPLookup_value, Table_array, 0 / True1 / False

Lookup_value

要查找或比對的內容

Table_array

要查找或比對的欄位

Col_index_num

返回值的範圍內的列號

Range_lookup

0 / True精準比對

 

1 / False模糊比對

 




精準比對範例說明(1)

·         C欄對應到H欄:Lookup_value  輸入C3

·         D欄資料由I欄提供:Table_array 輸入 H4I7(截圖時把H6H7蓋住)。並且Col_index_num輸入 2

·         精準比對:Range_lookup 輸入0

 


 


精準比對範例說明(2)

·         C欄對應到H欄:Lookup_value  輸入C3

·         D欄資料由J欄提供:Table_array 輸入 H4J7。並且Col_index_num輸入 3

·         精準比對:Range_lookup 輸入 0

 

說明(1)和說明(2)的差異就在Table_array範圍及Col_index_numH欄往右推幾列。

 


模糊比對範例說明(3)

·         C欄對應到I欄:Lookup_value  輸入C3

·         D欄資料由J欄提供:Table_array 輸入 H4I7。並且Col_index_num輸入 2

·         模糊比對:Range_lookup 輸入 1

 

說明(3)和說明(1)的差異就在Range_lookup 輸入1C欄部分字串與H欄相符。

3/23/2022

Powershell Print 的參數說明

 

參數
說明
`o
字串結束符號,此符號無法列印。
`a
警告符號,ASCII碼為7的字元。
`b
退格,刪除前一個字元。
`f
換頁或分頁符號,會讓印表機在新的一頁上開始列印。
`n
分行符號,使印表機或終端在新的一行開始列印。
`r
Return符號
`t
水平定位字元,同功能。
`v
垂直定位字元

如何利用 Powershell 設定檔案屬性

 Powershell 提供兩種方式設定檔案屬性的設定值。

  • 屬性名稱表示
  • $file = Get-Item .\x.exe
    $file.attributes = "ReadOnly"

  • 屬性數值表示(16位元數值)
  • $file = Get-Item .\x.exe
    $file.attributes = 0x20

兩者的對照表如下:
屬性名稱
屬性數值
ReadOnly
0x01
Hidden
0x02
System
0x04
Directory
0x10
Archive
0x20
Device
0x40
Normal
0x80
Temporary
0x100
SparseFile
0x200
ReparsePoint
0x400
Compressed
0x800

依照以上的說明,我們也可以同時設定兩組以上屬性。
  • 屬性名稱表示
  • $file = Get-Item .\x.exe
    $file.attributes = "ReadOnly,Archive"

  • 屬性數值表示(16位元數值)
  • $file = Get-Item .\x.exe
    $file.attributes = 0x21

Powershell的格式運算子

 此運算子是採用.NET提供的格式化機制,相關格式化資料請參考Formatting Types




數值格式
名稱
"C" or "c"
貨幣
"D" or "d"
十進位
"E" or "e"
指數
"F" or "f"
浮點
"G" or "g"
一般數值
"N" or "n"
Number格式
"P" or "p"
百分比
"X" or "x"
十六進位


日期及時間格式
說明
"d"
不顯示星期的日期.
"D"
顯示星期的日期.
"f"
日期(含星期)及時間(不顯示秒數)
"F"
日期(含星期)及時間(顯示秒數)
"g"
日期及時間(不顯示秒數)
"G"
日期(含星期)及時間(顯示秒數)
"M", "m"
日期 (只顯示月份和日期 )
"O", "o"
Round-trip date/time pattern.
"R", "r"
RFC1123 pattern. (GMT)
"t"
顯示時間(不顯示秒數)
"T"
顯示時間(顯示秒數)
"u"
Universal sortable date/time pattern.
"U"
Universal full date/time pattern.
"Y", "y"
顯示年和月份

    使用方式:
    "{格式}" -f  "欲格式化的值"
    • 單一參數使用方式
    • PS C:\> $VAR_NUM = 1234.1234567
      PS C:\> "{0:C}" -f  $VAR_NUM
      $1,234.12

    • 多參數使用方式
    • PS C:> $VAR_DATE = Get-Date
      PS C:> $VAR_STR = "Today is"
      PS C:> $VAR_STR + $VAR_DATE
      Today is 07/21/2012 15:22:47
      PS C:\> "{0}{1:d}" -f ($VAR_STR,$VAR_DATE)
      Today is 7/21/2012
      {0}對應到$VAR_STR
      {1:d}對應到$VAR_DATE