Back to Devexpress

Document.AppendSection() Method

officefileapi-devexpress-dot-xtrarichedit-dot-api-dot-native-dot-document-6b4f68a5.md

latest5.8 KB
Original Source

Document.AppendSection() Method

Appends a new empty section and returns the section to which this section is appended.

Namespace : DevExpress.XtraRichEdit.API.Native

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

NuGet Package : DevExpress.RichEdit.Core

Declaration

csharp
Section AppendSection()
vb
Function AppendSection As Section

Returns

TypeDescription
Section

A Section object that is the section in the document to which a new section is appended.

|

Remarks

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.

To get a newly appended section, use the following code:

csharp
wordProcessor.Document.AppendSection();
DevExpress.XtraRichEdit.API.Native.Section sApp = wordProcessor.Document.Sections[richEditControl.Document.Sections.Count - 1];
vb
wordProcessor.Document.AppendSection()
Dim sApp As DevExpress.XtraRichEdit.API.Native.Section = wordProcessor.Document.Sections(richEditControl.Document.Sections.Count - 1)

The following code snippets (auto-collected from DevExpress Examples) contain references to the AppendSection() method.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

winforms-richedit-document-api/CS/RichEditAPISample/CodeExamples/HeaderAndFooter.cs#L32

csharp
#region #ModifyHeader
document.AppendSection();
Section firstSection = document.Sections[0];

wpf-richedit-document-api/CS/DXRichEditControlAPISample/CodeExamples/HeaderAndFooterActions.cs#L32

csharp
#region #ModifyHeader
document.AppendSection();
Section firstSection = document.Sections[0];

word-document-api-examples/CS/CodeExamples/HeaderAndFooterActions.cs#L40

csharp
// Append a new section to the document.
document.AppendSection();

word-processing-merge-documents-with-different-headers-and-footers/CS/Helpers/DocumentsMerger.cs#L28

csharp
targetDoc.AppendSection();
targetServer.SaveDocument(outputFileName, DocumentFormat.OpenXml);

winforms-richedit-document-api/VB/RichEditAPISample/CodeExamples/HeaderAndFooter.vb#L28

vb
#Region "#ModifyHeader"
            document.AppendSection()
            Dim firstSection As DevExpress.XtraRichEdit.API.Native.Section = document.Sections(0)

wpf-richedit-document-api/VB/DXRichEditControlAPISample/CodeExamples/HeaderAndFooterActions.vb#L27

vb
' #Region "#ModifyHeader"
            document.AppendSection()
            Dim firstSection As Section = document.Sections(0)

word-processing-merge-documents-with-different-headers-and-footers/VB/Helpers/DocumentsMerger.vb#L25

vb
targetDoc.AppendSection()
targetServer.SaveDocument(outputFileName, DocumentFormat.OpenXml)

word-document-api-examples/VB/CodeExamples/HeaderAndFooterActions.vb#L34

vb
' Append a new section to the document.
document.AppendSection()
' Access the first document section.

See Also

Append()

Document Interface

Document Members

DevExpress.XtraRichEdit.API.Native Namespace