當(dāng)Word中插入的域很多時(shí),更新域就變得極為繁瑣,利用Word里面的宏功能,通過下面的VBA代碼可以一鍵快速更新文檔中的所有域。高效、方便。
Word中用于更新所有域的宏代碼: - Dim aField As Field
- Dim aStory As Range
-
- For Each aStory In ActiveDocument.StoryRanges
- For Each aField In aStory.Fields
- aField.Update
- Next aField
- Next aStory
|