I found this reference that will update all fields in a word document. http://www.gmayor.com/installing_macro.htm
Sub UpdateAll()
Dim oStory As Range
For Each oStory In ActiveDocument.StoryRanges
oStory.Fields.Update
If oStory.StoryType <> wdMainTextStory Then
While Not (oStory.NextStoryRange Is Nothing)
Set oStory = oStory.NextStoryRange
oStory.Fields.Update
Wend
End If
Next oStory
Set oStory = Nothing
End Sub
I would like to modify it to only fields of the DocProperty type update using this macro.
For example: I would like to update all DocProperty types while skipping all Ref types or all other types for that matter.
You can just check the fields
Typeproperty before updating, but you will have to loop through them.There are many ways to do this, but I put the loop in a sub, so you can just change your two update-lines from
to
Here’s the sub: