.NET Framework 4.5.2+
.NET Framework 4.5.2+
.NET Standard 2.0+

Document.InsertSection(DocumentPosition) Method

Inserts a new section into the document’s Document.Sections collection at a specified position.

Namespace: DevExpress.XtraRichEdit.API.Native

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


Section InsertSection(
    DocumentPosition pos


Name Type Description
pos DocumentPosition

A DocumentPosition object that specifies a position to insert a new section.


Type Description

A Section object that is the section in the document located before the newly inserted section.


When you create a new section, it’s automatically linked to the previous section and the content from the first section header is automatically inserted in the second section header. Remove this content before inserting a new content to the header. Call the SubDocument.Delete() method to clear the header.

The code sample below shows how to insert continuous section break after the specific paragraph:

Document document = server.Document;
Section insertedSection = document.GetSection(targetPosition);
insertedSection.StartType = SectionStartType.Continuous;
See Also