I am trying to set up a portrait header for a landscaped page in a document. Below is the code I am currently trying to insert a text box for the text:
On Error GoTo NoLandEvenHeader
ActiveWindow.ActivePane.View. _
SeekView = wdSeekEvenPagesHeader
Set myTextBox = varSection. _
Headers(wdHeaderFooterEvenPages).Shapes.AddTextbox _
(wdTextOrientationDownward, _
InchesToPoints(10), _
InchesToPoints(0.75), _
InchesToPoints(0.5), _
InchesToPoints(6.5))
myTextBox.Select
Selection.EndKey Unit:=wdLine, Extend:=wdMove
NoLandEvenHeader:
When the SeekView routine is called, if the section has only one page, then even or primary pages will fail with the Runtime Error 5895, “Requested View is Not Available.”
I understand why the view is not available, but the error trapping doesn’t catch it so that I can skip that header.
Of course I’d prefer a routine that would insert the text box for all 3 headers of a section, just in case the landscaped page changes from odd to even because of other pages inserted.
Thanks,
mike c.