S
SandyB
I have created a template where certain fields from document properties need to be updated. Fields in the body of the document update fine but any fields in the header/footer area do not update. You have to open the hedaer/footer area and update each section separately. The only way I could do this was based on there always being a specific number of sections. What I really want is a macro that updates the header/footer area regardless of the number of sections
My existing macro is shown below..
Sub FooterUpdate(
' FooterUpdate Macro Updates footers in 3 Section
' Macro recorded 02/02/2004 by Sandy
Selection.HomeKey Unit:=wdStor
If ActiveWindow.View.SplitSpecial <> wdPaneNone The
ActiveWindow.Panes(2).Clos
End I
If ActiveWindow.ActivePane.View.Type = wdNormalView Or ActiveWindow.
ActivePane.View.Type = wdOutlineView The
ActiveWindow.ActivePane.View.Type = wdPrintVie
End I
ActiveWindow.ActivePane.View.SeekView = wdSeekCurrentPageHeade
If Selection.HeaderFooter.IsHeader = True The
ActiveWindow.ActivePane.View.SeekView = wdSeekCurrentPageFoote
Els
ActiveWindow.ActivePane.View.SeekView = wdSeekCurrentPageHeade
End I
Selection.WholeStor
Selection.Fields.Updat
ActiveWindow.ActivePane.View.NextHeaderFoote
Selection.WholeStor
Selection.Fields.Updat
ActiveWindow.ActivePane.View.NextHeaderFoote
Selection.WholeStor
Selection.Fields.Updat
ActiveWindow.ActivePane.View.SeekView = wdSeekMainDocumen
End Sub
My existing macro is shown below..
Sub FooterUpdate(
' FooterUpdate Macro Updates footers in 3 Section
' Macro recorded 02/02/2004 by Sandy
Selection.HomeKey Unit:=wdStor
If ActiveWindow.View.SplitSpecial <> wdPaneNone The
ActiveWindow.Panes(2).Clos
End I
If ActiveWindow.ActivePane.View.Type = wdNormalView Or ActiveWindow.
ActivePane.View.Type = wdOutlineView The
ActiveWindow.ActivePane.View.Type = wdPrintVie
End I
ActiveWindow.ActivePane.View.SeekView = wdSeekCurrentPageHeade
If Selection.HeaderFooter.IsHeader = True The
ActiveWindow.ActivePane.View.SeekView = wdSeekCurrentPageFoote
Els
ActiveWindow.ActivePane.View.SeekView = wdSeekCurrentPageHeade
End I
Selection.WholeStor
Selection.Fields.Updat
ActiveWindow.ActivePane.View.NextHeaderFoote
Selection.WholeStor
Selection.Fields.Updat
ActiveWindow.ActivePane.View.NextHeaderFoote
Selection.WholeStor
Selection.Fields.Updat
ActiveWindow.ActivePane.View.SeekView = wdSeekMainDocumen
End Sub