Version

InsertPageNumberField(Int32,PageNumberFieldFormat) Method

Inserts a PageNumberField into the associated Paragraph at the specified ordinal position.
Syntax
'Declaration
 
Public Overloads Function InsertPageNumberField( _
   ByVal index As Integer, _
   ByVal format As PageNumberFieldFormat _
) As PageNumberField
public PageNumberField InsertPageNumberField( 
   int index,
   PageNumberFieldFormat format
)

Parameters

index
The ordinal position within this collection at which to insert the text run.
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