共用方式為


Document.TextEncoding 屬性

取得或設定字碼頁 (Code Page) 或字元集 (Character Set),Microsoft Office Word 會針對儲存為編碼文字檔的文件使用這些設定。

命名空間:  Microsoft.Office.Tools.Word
組件:   Microsoft.Office.Tools.Word.v4.0.Utilities (在 Microsoft.Office.Tools.Word.v4.0.Utilities.dll 中)
  Microsoft.Office.Tools.Word (在 Microsoft.Office.Tools.Word.dll 中)

語法

'宣告
Property TextEncoding As MsoEncoding
MsoEncoding TextEncoding { get; set; }

屬性值

型別:Microsoft.Office.Core.MsoEncoding
其中一個 MsoEncoding 值。

備註

此屬性會設定別於 HTML 編碼方式的文字編碼方式,而 HTML 編碼方式則是使用 WebOptions 物件的 Encoding 屬性加以設定。您可以從 WebOptions 屬性取得 WebOptions 物件。若要針對儲存為文字檔的所有文件設定文字編碼方式,請使用 DefaultTextEncoding 屬性。

.NET Framework 安全性

請參閱

參考

Document 介面

Microsoft.Office.Tools.Word 命名空間