Version

AddPageNumberField Method (ContentRunsCollection)

Adds a PageNumberField to the associated Paragraph.
Syntax
'Declaration
 
Public Function AddPageNumberField( _
   ByVal format As PageNumberFieldFormat _
) As PageNumberField
public PageNumberField AddPageNumberField( 
   PageNumberFieldFormat format
)

Parameters

format
A PageNumberFieldFormat constant which defines the format for the page number field.

Return Value

A PageNumberField instance.
Remarks

Note: Page number fields are only supported for content which appears within a header or footer. Attempting to add a page number field to content which appears within the main document part will cause an exception to be thrown.

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