HeaderFooter.PageNumbers property (Word)

Returns a PageNumbers collection that represents all the page number fields included in the specified header or footer.

Syntax

expression. PageNumbers

expression An expression that returns a 'HeaderFooter' object.

Remarks

For information about returning a single member of a collection, see Returning an object from a collection.

Example

This example creates a new document and adds page numbers to the footer.

Set myDoc = Documents.Add 
With myDoc.Sections(1).Footers(wdHeaderFooterPrimary) 
 .PageNumbers.Add PageNumberAlignment := wdAlignPageNumberCenter 
End With

See also

HeaderFooter Object

Support and feedback

Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.