L
Lori Luli
We have a large number of big documents(500+ pgs) that
frequently switch back and forth between portrait and
landscape. A section break (next page) is used between
each orientation change, so there are LOTS of sections in
each document.
We now need to go into these documents and re-format the
headers an footers, with portrait header/footers being
different from those of landscape.
The sections all have "Same as Previous" turned on for
both the header and the footer. I've been trying to
generate a macro that will go into the header of a
section, turn off "Same as Previous", switch to the footer
of that same section and turn off "Same as Previous", then
move to the next section.
The following code is my latest (failed) attempt. It
turns off "Same as Previous" for the current header, the
next footer, and does not advance to the next section.
Sub ClearSameAsPrev()
' Make sure the document is in Print Layout mode
Set myView = ActiveWindow.ActivePane.View
myView.Type = wdPrintView
' Turn off "Same as Previous" for header
myView.SeekView = wdSeekCurrentPageHeader
Selection.HeaderFooter.LinkToPrevious = False
' Turn off "Same as Previous" for footer
myView.SeekView = wdSeekCurrentPageFooter
Selection.HeaderFooter.LinkToPrevious = False
' Go to next Section
myView.NextHeaderFooter
End Sub
Any suggestions??
frequently switch back and forth between portrait and
landscape. A section break (next page) is used between
each orientation change, so there are LOTS of sections in
each document.
We now need to go into these documents and re-format the
headers an footers, with portrait header/footers being
different from those of landscape.
The sections all have "Same as Previous" turned on for
both the header and the footer. I've been trying to
generate a macro that will go into the header of a
section, turn off "Same as Previous", switch to the footer
of that same section and turn off "Same as Previous", then
move to the next section.
The following code is my latest (failed) attempt. It
turns off "Same as Previous" for the current header, the
next footer, and does not advance to the next section.
Sub ClearSameAsPrev()
' Make sure the document is in Print Layout mode
Set myView = ActiveWindow.ActivePane.View
myView.Type = wdPrintView
' Turn off "Same as Previous" for header
myView.SeekView = wdSeekCurrentPageHeader
Selection.HeaderFooter.LinkToPrevious = False
' Turn off "Same as Previous" for footer
myView.SeekView = wdSeekCurrentPageFooter
Selection.HeaderFooter.LinkToPrevious = False
' Go to next Section
myView.NextHeaderFooter
End Sub
Any suggestions??