"Document" 属性 (Word)Document.Fields property (Word)

返回一个**fields** 集合, 该集合代表文档中的所有域。Returns a Fields collection that represents all the fields in the document. 此为只读属性。Read-only.


expression.expression. Fields

_表达式_是必需的。expression Required. 一个代表 Document 对象的变量。A variable that represents a Document object.


本示例更新活动文档中所有的域。This example updates all the fields in the active document.


本示例删除活动文档正文和页脚中的所有域。This example removes all the fields from the main text story and the footer in the active document.

For Each aField in ActiveDocument.Fields 
Next aField 
Set myRange = ActiveDocument.Sections(1).Footers _ 
For Each aField In myRange.Fields 
Next aField

另请参阅See also

Document 对象Document Object

支持和反馈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.