Jim...I already use this macro..it updates everything EXCEPT the header and footer fields.
Try changing the macro to this:
Dim aStory As Range
Dim aField As Field
For Each aStory In ActiveDocument.StoryRanges
For Each aField In aStory.Fields
See this KB article for a step by step guide.
That's exactly what I have Jim...
Jim, Good morning. I just want to make sure that you understood that my word macro, the one that you posted below does work as it should as it updates all of the fields in the body of the word document, just not the fields in the headers or footers.
Does your template contain header or footer fields and if so do they automatically update when the data card is filled in?
Dim rngStory As Word.Range
Dim oShp As Word.Shape
'This updates all fields in the word file.
For Each rngStory In ActiveDocument.StoryRanges
On Error Resume Next
Select Case rngStory.StoryType
Case 6, 7, 8, 9, 10, 11
If rngStory.ShapeRange.Count > 0 Then
For Each oShp In rngStory.ShapeRange
If oShp.TextFrame.HasText Then
On Error GoTo 0
'Get next linked story (if any)
Set rngStory = rngStory.NextStoryRange
Loop Until rngStory Is Nothing
Jason, thanks but that one caused no fields to update
I wanted to share my findings on this issue that has it working now.
I opened the template in word and manually put in values for all of the custom fields both in the header and footer.
I then saved the template and closed it.
Then in the data card I deleted all of the values, leaving me with a blank data card.
Checked in the template and now when I create a new template, ALL fields update.
Its odd, but it worked.
Now that I have the fields updating, I am noticing that they only update on sheet one. Any custom properties in the headers and footers only update on sheet one, none of the consecutive sheets update. Any help would be appreciated.