H
Holuigue
I need to frequently add a header (first page only)
I went through the process of recording a Macro, but when running it, I get
the following error message;
Run-time error '5941'
The requested member of the collection does not exist.
Not funny, since, as a first step, I picked a header in the "Built-in"
collection.
The code generated is as follows:
Sub Header()
'
' Header Macro
'
'
If ActiveWindow.View.SplitSpecial <> wdPaneNone Then
ActiveWindow.Panes(2).Close
End If
If ActiveWindow.ActivePane.View.Type = wdNormalView Or ActiveWindow. _
ActivePane.View.Type = wdOutlineView Then
ActiveWindow.ActivePane.View.Type = wdPrintView
End If
ActiveWindow.ActivePane.View.SeekView = wdSeekCurrentPageHeader
ActiveDocument.AttachedTemplate.BuildingBlockEntries("Alphabet").Insert _
Where:=Selection.Range, RichText:=True
ActiveWindow.ActivePane.View.SeekView = wdSeekMainDocument
ActiveWindow.Close
Application.Quit
End Sub
I went through the process of recording a Macro, but when running it, I get
the following error message;
Run-time error '5941'
The requested member of the collection does not exist.
Not funny, since, as a first step, I picked a header in the "Built-in"
collection.
The code generated is as follows:
Sub Header()
'
' Header Macro
'
'
If ActiveWindow.View.SplitSpecial <> wdPaneNone Then
ActiveWindow.Panes(2).Close
End If
If ActiveWindow.ActivePane.View.Type = wdNormalView Or ActiveWindow. _
ActivePane.View.Type = wdOutlineView Then
ActiveWindow.ActivePane.View.Type = wdPrintView
End If
ActiveWindow.ActivePane.View.SeekView = wdSeekCurrentPageHeader
ActiveDocument.AttachedTemplate.BuildingBlockEntries("Alphabet").Insert _
Where:=Selection.Range, RichText:=True
ActiveWindow.ActivePane.View.SeekView = wdSeekMainDocument
ActiveWindow.Close
Application.Quit
End Sub