A
Alex
Hi Guys
As you all probably know within TOOLS\OPTIONS\PRINT there
is an update fields and update links option before
printing. These options actually update all the fields /
links in all the stories of a word document.
Does anyone know how to reproduce this function, i.e.
updating all the fields in all the stories via VBA, that
way I can update my document fields whenever I want to
without having to print the document or without having to
update each field individually.
I've search the MS Knowledge Base and found the following
code, but it doesn't appear to work:
Sub UpdateAllFields()
Dim aStory As Range
Dim aField As Field
For Each aStory In ActiveDocument.StoryRanges
For Each aField In aStory.Fields
aField.Update
Next aField
Next aStory
End Sub
I've also checked the MVP site and found an article
referencing stories but my VBA skills are too basic to
understand the finer points of the article, i.e. how to
modify it.
Hope someone can help.
Big thank you in advance
Alex
As you all probably know within TOOLS\OPTIONS\PRINT there
is an update fields and update links option before
printing. These options actually update all the fields /
links in all the stories of a word document.
Does anyone know how to reproduce this function, i.e.
updating all the fields in all the stories via VBA, that
way I can update my document fields whenever I want to
without having to print the document or without having to
update each field individually.
I've search the MS Knowledge Base and found the following
code, but it doesn't appear to work:
Sub UpdateAllFields()
Dim aStory As Range
Dim aField As Field
For Each aStory In ActiveDocument.StoryRanges
For Each aField In aStory.Fields
aField.Update
Next aField
Next aStory
End Sub
I've also checked the MVP site and found an article
referencing stories but my VBA skills are too basic to
understand the finer points of the article, i.e. how to
modify it.
Hope someone can help.
Big thank you in advance
Alex