WebOptions 对象(Word)WebOptions object (Word)

包含当您将文档另存为网页或打开网页时 Microsoft Word 使用的文档级属性。Contains document-level attributes used by Microsoft Word when you save a document as a webpage or open a webpage.


您可以在应用程序(全局)级返回或设置属性,也可以在文档级返回或设置。You can return or set attributes either at the application (global) level or at the document level. (请注意,每个文档的属性值可能不同,具体取决于保存文档时的属性值。)文档级属性设置将覆盖应用程序级别的属性设置。(Note that attribute values can be different from one document to another, depending on the attribute value at the time the document was saved.) Document-level attribute settings override application-level attribute settings. 应用程序级属性包含在 DefaultWebOptions 对象中。Application-level attributes are contained in the DefaultWebOptions object.

使用 web 选项 属性以返回 web 选项 对象。Use the WebOptions property to return the WebOptions object. 以下示例检查是否允许将 PNG(可移植网络图形)用作图像格式,然后相应地设置 strImageFileType 变量。The following example checks to see whether PNG (Portable Network Graphics) is allowed as an image format and then sets the strImageFileType variable accordingly.

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

另请参阅See also

Word 对象模型参考Word Object Model Reference

支持和反馈Support and feedback

有关于 Office VBA 或本文档的疑问或反馈?Have questions or feedback about Office VBA or this documentation? 请参阅 Office VBA 支持和反馈,获取有关如何接收支持和提供反馈的指南。Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.