Skip to main content

Section Interface

An interface that defines a section within a document.

Namespace: DevExpress.XtraRichEdit.API.Native

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

NuGet Packages: DevExpress.RichEdit.Core, DevExpress.Win.Navigation

Declaration

[ComVisible(true)]
public interface Section

The following members return Section objects:

Example

The following code sample shows how to insert a continuous section break after the specified paragraph:

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

using (var wordProcessor = new RichEditDocumentServer())
{
    wordProcessor.LoadDocument(@"Documents//Alice.docx");

    Document document = wordProcessor.Document;
    var section = document.InsertSection(document.Paragraphs[4].Range.End);

    // Retrieve the inserted section
    var sectionPosition = document.CreatePosition(section.Range.End.ToInt() + 1);
    Section insertedSection = document.GetSection(sectionPosition);
    insertedSection.StartType = SectionStartType.Continuous;

    wordProcessor.SaveDocument("Alice_formatted.docx", DocumentFormat.OpenXml);   
}
See Also