WebOptions 对象

         
Documents (Document)
WebOptions

当将文档另存为 Web 页或打开 Web 页时,将包含 Microsoft Word 所用的文档级属性。可以在应用程序(全局的)级或文档级返回或设置属性(请注意:各文档间的该属性值可能有所不同,这取决于存储各文档时的属性值)。文档级的属性设置会覆盖应用程序级的属性设置。应用程序级的属性包含在 DefaultWebOptions 对象中。

使用 WebOptions 对象

WebOptions 属性可返回 WebOptions 对象。下例实现的功能是:检查是否允许 PNG(便携网络图形)作为图像格式,然后设置相应的 strImageFileType 变量。

Set objAppWebOptions = ActiveDocument.WebOptions
With objAppWebOptions
    If .AllowPNG = True Then
        strImageFileType = "PNG"
    Else
        strImageFileType = "JPG"
    End If
End With