Class PageNumbers (Word VBA)
A collection of PageNumber objects that represent the page numbers in a single header or footer.
Class HeaderFooter gives access to class PageNumbers.
Dim pns as PageNumbers
Set pns = Selection.HeaderFooter.PageNumbers
For Each
Here is an example of processing the PageNumbers items in a collection.
Dim pnr As PageNumber
For Each pnr In Selection.HeaderFooter.PageNumbers
Next pnr
Methods
Add - Returns a PageNumber object that represents page numbers added to a header or footer in a section.
Item - Returns an individual PageNumber object in a collection.
Properties
ChapterPageSeparator returns or sets the separator character used between the chapter number and the page number.
Count returns a Long that represents the number of page numbers in the collection.
DoubleQuote true if Microsoft Word encloses the specified PageNumbers object in double quotation marks (").
HeadingLevelForChapter returns or sets the heading level style that's applied to the chapter titles in the document.
IncludeChapterNumber true if a chapter number is included with page numbers or a caption label.
NumberStyle returns or sets a WdPageNumberStyle constant that represents the number style.
RestartNumberingAtSection true if page numbering starts at 1 again at the beginning of the specified section.
ShowFirstPageNumber true if the page number appears on the first page in the section.
StartingNumber returns or sets the starting note number, line number, or page number.