Selection.HeaderFooter (Word)

Returns a HeaderFooter object for the specified selection.

An error occurs if the selection isn't located within a header or footer.


With ActiveDocument.ActiveWindow.View 
 .Type = wdPrintView 
 .SeekView = wdSeekCurrentPageFooter 
End With 
Selection.HeaderFooter.PageNumbers.Add _ 
 PageNumberAlignment:=wdAlignPageNumberCenter