Add Method (PageNumbers Collection)

See Also         Example         Applies To

Adds page numbers to a header or footer in a section.

Syntax

expression.Add(PageNumberAlignment, FirstPage)

expression   Required. An expression that returns a PageNumbers object.

PageNumberAlignment   Optional Variant. Can be one of the following WdPageNumberAlignment constants: wdAlignPageNumberCenter, wdAlignPageNumberInside, wdAlignPageNumberLeft, wdAlignPageNumberOutside, or wdAlignPageNumberRight.

FirstPage   Optional Variant. False to make the first-page header and the first-page footer different from the headers and footers on all subsequent pages in the document. If FirstPage is set to False, a page number isn't added to the first page. If this argument is omitted, the setting is controlled by the DifferentFirstPageHeaderFooter property.

Remarks

If the LinkToPrevious property for the HeaderFooter object is set to True, the page numbers will continue sequentially from one section to next throughout the document.