Share via


Word) (Document.Fields 屬性

會傳回代表文件中所有欄位 Fields 集合。 唯讀。

語法

expression. Fields

需要 expression。 代表 Document 物件的變數。

範例

本範例會更新使用中文件裡的所有欄位。

ActiveDocument.Fields.Update

此範例會移除使用中文件裡,主要文字本文及頁尾中的所有欄位。

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

另請參閱

Document 物件

支援和意見反應

有關於 Office VBA 或這份文件的問題或意見反應嗎? 如需取得支援服務並提供意見反應的相關指導,請參閱 Office VBA 支援與意見反應