K
Kamran
Hello,
I want to use the code below to populate a header with info in Word form.
There are two fields. In the second field I have selected the macro for "Run
macro on Exit", but it doesn't work. The header fields stay unchanged. What
am I missing?
[From 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 want to use the code below to populate a header with info in Word form.
There are two fields. In the second field I have selected the macro for "Run
macro on Exit", but it doesn't work. The header fields stay unchanged. What
am I missing?
[From 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