DocumentBase.WebOptions 属性

定义

获取一个 WebOptions 对象,该对象包含在您将文档另存为网页或者打开网页时,Microsoft Office Word 使用的文档级特性。

public Microsoft.Office.Interop.Word.WebOptions WebOptions { get; }

属性值

WebOptions

一个 WebOptions 对象,该对象包含在您将文档另存为网页或者打开网页时,Microsoft Office Word 使用的文档级特性。

示例

下面的代码示例指定将活动文档中的项保存到网页时使用的是级联样式表和西方文档编码。 若要使用此示例,请在 ThisDocument 文档级项目的类中运行它。

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

适用于