Selection.HeaderFooter Property (Word)

Returns a HeaderFooter object for the specified selection. Read-only.

Syntax

expression .HeaderFooter

expression A variable that represents a Selection object.

Remarks

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

Example

This example adds a centered page number to the current page footer.

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

See Also

Concepts

Selection Object

Selection Object Members