PageNumbers Property

Microsoft Word Visual Basic

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

expression.PageNumbers

expression    Required. 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