Version

AddPageNumberField(PageNumberFieldFormat,Font) Method

Adds a page numbering field to the current paragraph.
Syntax
'Declaration
 
Public Overloads Sub AddPageNumberField( _
   ByVal format As PageNumberFieldFormat, _
   ByVal font As Font _
) 
public void AddPageNumberField( 
   PageNumberFieldFormat format,
   Font font
)

Parameters

format
A PageNumberFieldFormat value which defines the format for the page number.
font
A Font instance which defines the formatting attributes for 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 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