M
Mary
I have inserted the Title field into the footer of my
document, however, if I change the document title the
footer does not automatically update.
I added this procedure to the open event of the document,
it was working fine but now it is showing an error.
Run time error 91 - object variable or with not set
Can anyone help?? Thanks for your time.
__________
Private Sub Document_Open()
'move to page 2 of the document
Selection.HomeKey unit:=wdStory
Selection.GoTo What:=wdGoToPage,
Which:=wdGoToNext, Count:=1
'update fields in the header
ActiveWindow.ActivePane.View.SeekView =
wdSeekCurrentPageHeader
Selection.HeaderFooter.LinkToPrevious = True
Selection.WholeStory
Selection.Fields.Update
'update fields in the footer
ActiveWindow.ActivePane.View.SeekView =
wdSeekCurrentPageFooter
Selection.WholeStory
Selection.Fields.Update
'Close Header Footer view & return to the top of the doc
ActiveWindow.ActivePane.View.SeekView =
wdSeekMainDocument
Selection.HomeKey unit:=wdStory
End Sub
document, however, if I change the document title the
footer does not automatically update.
I added this procedure to the open event of the document,
it was working fine but now it is showing an error.
Run time error 91 - object variable or with not set
Can anyone help?? Thanks for your time.
__________
Private Sub Document_Open()
'move to page 2 of the document
Selection.HomeKey unit:=wdStory
Selection.GoTo What:=wdGoToPage,
Which:=wdGoToNext, Count:=1
'update fields in the header
ActiveWindow.ActivePane.View.SeekView =
wdSeekCurrentPageHeader
Selection.HeaderFooter.LinkToPrevious = True
Selection.WholeStory
Selection.Fields.Update
'update fields in the footer
ActiveWindow.ActivePane.View.SeekView =
wdSeekCurrentPageFooter
Selection.WholeStory
Selection.Fields.Update
'Close Header Footer view & return to the top of the doc
ActiveWindow.ActivePane.View.SeekView =
wdSeekMainDocument
Selection.HomeKey unit:=wdStory
End Sub