officefileapi-devexpress-dot-xtrarichedit-dot-api-dot-native-b991ab12.md
An interface that defines a section within a document.
Namespace : DevExpress.XtraRichEdit.API.Native
Assembly : DevExpress.RichEdit.v25.2.Core.dll
NuGet Package : DevExpress.RichEdit.Core
[ComVisible(true)]
public interface Section
<ComVisible(True)>
Public Interface Section
The following members return Section objects:
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.Docx);
}
Imports DevExpress.XtraRichEdit
Imports DevExpress.XtraRichEdit.API.Native
Using wordProcessor = New RichEditDocumentServer()
wordProcessor.LoadDocument("Documents//Alice.docx")
Dim document As Document = wordProcessor.Document
Dim section = document.InsertSection(document.Paragraphs(4).Range.End)
' Retrieve the inserted section
Dim sectionPosition = document.CreatePosition(section.Range.End.ToInt() + 1)
Dim insertedSection As Section = document.GetSection(sectionPosition)
insertedSection.StartType = SectionStartType.Continuous
wordProcessor.SaveDocument("Alice_formatted.docx", DocumentFormat.Docx)
End Using
See Also