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

Section Interface

An interface that defines a section within a document.

Namespace: DevExpress.XtraRichEdit.API.Native

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

NuGet Package: DevExpress.RichEdit.Core

#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