Sub AddCatchwordsToFooter()
Dim sView As String
'record preferred view
sView = ActiveWindow.ActivePane.View.Type
'Select PrintLayout
view
ActiveWindow.ActivePane.View.Type = wdPrintView
'Open footer
ActiveWindow.ActivePane.View.SeekView = wdSeekCurrentPageFooter
With Selection
'Align fields to right
margin
.ParagraphFormat.Alignment = wdAlignParagraphRight
'Insert the fields
.Fields.Add Range:=.Range, Type:=wdFieldEmpty, _
PreserveFormatting:=False
.TypeText Text:="IF"
.Fields.Add Range:=.Range, Type:=wdFieldEmpty, _
PreserveFormatting:=False
.TypeText Text:="Page"
.MoveRight Unit:=wdCharacter, Count:=2
.TypeText Text:=" < "
.Fields.Add Range:=.Range, Type:=wdFieldEmpty, _
PreserveFormatting:=False
.TypeText Text:="Numpages"
.MoveRight Unit:=wdCharacter, Count:=2
.TypeText Text:=" """
.Fields.Add Range:=.Range, Type:=wdFieldEmpty, _
PreserveFormatting:=False
.TypeText Text:="REF ""Word"
.Fields.Add Range:=.Range, Type:=wdFieldEmpty, _
PreserveFormatting:=False
.TypeText Text:="Page"
.MoveRight Unit:=wdCharacter,
Count:=2
.TypeText Text:=""""
.MoveRight Unit:=wdCharacter,
Count:=2
.TypeText Text:=" ...."""
.MoveRight Unit:=wdCharacter,
Count:=2
End With
'Close the footer
ActiveWindow.ActivePane.View.SeekView = wdSeekMainDocument
'Return to the
stored preferred view
ActiveWindow.ActivePane.View.Type = sView
'Update the fields
ActiveDocument.PrintPreview
ActiveDocument.ClosePrintPreview
'Ensure
field results are displayed
ActiveWindow.View.ShowFieldCodes = False
End Sub