Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

SectionPageNumbering Interface

Exposes members used to specify page numbering options.

Namespace: DevExpress.XtraRichEdit.API.Native

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

NuGet Package: DevExpress.RichEdit.Core

#Declaration

[ComVisible(true)]
public interface SectionPageNumbering

The following members return SectionPageNumbering objects:

#Remarks

Use the SectionPageNumbering class properties to specify section page numbering options. Before you apply new options, set the SectionPageNumbering.ContinueNumbering property to false to reset numbering options.

The PAGE field shows a document’s page number. To apply new settings to existing page numbers, call the Document.UpdateAllFields() method to update all fields.

#Example

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

image

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();
}
See Also