Share via


DocumentBase.WebOptions 屬性

取得 WebOptions 物件,其中包含當您將文件另存為網頁或開啟網頁時,Microsoft Office Word 所使用的文件層級屬性。

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

語法

'宣告
Public ReadOnly Property WebOptions As WebOptions
public WebOptions WebOptions { get; }

屬性值

型別:Microsoft.Office.Interop.Word.WebOptions
WebOptions 物件,其中包含當您將文件另存為網頁或開啟網頁時,Microsoft Office Word 所使用的文件層級屬性。

範例

下列範例顯示當現用文件的項目另存為網頁時,程式碼會指定所使用的階層式樣式表和 Western 文件編碼方式。 若要使用這個範例,請在文件層級專案中的 ThisDocument 類別執行。

Private Sub DocumentWebOptions()
    Me.WebOptions.RelyOnCSS = True
    Me.WebOptions.Encoding = Office.MsoEncoding.msoEncodingWestern
End Sub 
private void DocumentWebOptions()
{
    this.WebOptions.RelyOnCSS = true;
    this.WebOptions.Encoding = Office.MsoEncoding.msoEncodingWestern;
}

.NET Framework 安全性

請參閱

參考

DocumentBase 類別

Microsoft.Office.Tools.Word 命名空間