Version

AddPageNumberField(PageNumberField) Method

Adds a page numbering field to the current paragraph.
Syntax
'Declaration
 
Public Overloads Overrides Sub AddPageNumberField( _
   ByVal pageNumberField As PageNumberField _
) 
public override void AddPageNumberField( 
   PageNumberField pageNumberField
)

Parameters

pageNumberField
A PageNumberField value which defines the properties of the page number.
Remarks

This method can only be called when a paragraph is currently open. A page number field is similar to a text run; it can be embedded within the paragraph adjacent to any other kind of content such as text, images, or hyperlinks.

A page number field can be added to either a header or footer.

The page number for the first page in a section can be explicitly set using the StartingPageNumber property. When this property is not explicitly set, page numbers for new sections continue sequentially from the last page of the previous section.

Requirements

Target Platforms: Windows 10, Windows 8.1, Windows 8, Windows 7, Windows Server 2012, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also