Back to Devexpress

Section.PageNumbering Property

officefileapi-devexpress-dot-xtrarichedit-dot-api-dot-native-dot-section-48358be2.md

latest2.8 KB
Original Source

Section.PageNumbering Property

Provides access to an object specifying page numbering options for the current section.

Namespace : DevExpress.XtraRichEdit.API.Native

Assembly : DevExpress.RichEdit.v25.2.Core.dll

NuGet Package : DevExpress.RichEdit.Core

Declaration

csharp
SectionPageNumbering PageNumbering { get; }
vb
ReadOnly Property PageNumbering As SectionPageNumbering

Property Value

TypeDescription
SectionPageNumbering

A SectionPageNumbering instance containing page numbering options.

|

Example

The following code sample specifies the initial number and NumberingFormat.CardinalText numbering format, and inserts the PAGE field to the section footer.

csharp
using DevExpress.XtraRichEdit;
using DevExpress.XtraRichEdit.API.Native;

using (var wordProcessor = new RichEditDocumentServer())
{
    wordProcessor.CreateNewDocument();
    Section section = wordProcessor.Document.Sections[0];
    section.PageNumbering.ContinueNumbering = false;
    section.PageNumbering.FirstPageNumber = 3;
    section.PageNumbering.NumberingFormat = NumberingFormat.CardinalText;

    var footer = section.BeginUpdateFooter();
    footer.Fields.Create(footer.Range.End, "PAGE");
    section.EndUpdateFooter(footer);

    wordProcessor.Document.UpdateAllFields();
}
vb
Imports DevExpress.XtraRichEdit
Imports DevExpress.XtraRichEdit.API.Native

Using wordProcessor As New RichEditDocumentServer()
    wordProcessor.CreateNewDocument()
    Dim section As Section = wordProcessor.Document.Sections(0)
    section.PageNumbering.ContinueNumbering = False
    section.PageNumbering.FirstPageNumber = 3
    section.PageNumbering.NumberingFormat = NumberingFormat.CardinalText

    Dim footer = section.BeginUpdateFooter()
    footer.Fields.Create(footer.Range.End, "PAGE")
    section.EndUpdateFooter(footer)

    wordProcessor.Document.UpdateAllFields()
End Using

See Also

Section Interface

Section Members

DevExpress.XtraRichEdit.API.Native Namespace