D
Daniel W
Hello all
Have used a macro that updates fields in the header when the document is
opened.
Now I want to expand so it updates fields in whole document.
Code works but it displays a dialog that the user has to click Yes to.
Message in dialog: Word cannot undo this action. Do you want to continue?
Is there any way to suppress this message or maybe use SendKeys?
Code:
Sub AutoOpen()
ActiveWindow.Caption = ActiveDocument.FullName
Dim oStory As Range
For Each oStory In ActiveDocument.StoryRanges
' If oStory.StoryType = wdPrimaryHeaderStory Or oStory.StoryType =
wdFirstPageHeaderStory Then
oStory.Fields.Update
' End If
Next oStory
Set oStory = Nothing
End Sub
Thanks
Daniel
Have used a macro that updates fields in the header when the document is
opened.
Now I want to expand so it updates fields in whole document.
Code works but it displays a dialog that the user has to click Yes to.
Message in dialog: Word cannot undo this action. Do you want to continue?
Is there any way to suppress this message or maybe use SendKeys?
Code:
Sub AutoOpen()
ActiveWindow.Caption = ActiveDocument.FullName
Dim oStory As Range
For Each oStory In ActiveDocument.StoryRanges
' If oStory.StoryType = wdPrimaryHeaderStory Or oStory.StoryType =
wdFirstPageHeaderStory Then
oStory.Fields.Update
' End If
Next oStory
Set oStory = Nothing
End Sub
Thanks
Daniel