officefileapi-devexpress-dot-xtrarichedit-dot-api-dot-native-dot-document-6b4f68a5.md
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
Section AppendSection()
Function AppendSection As Section
| Type | Description |
|---|---|
| Section |
A Section object that is the section in the document to which a new section is appended.
|
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:
wordProcessor.Document.AppendSection();
DevExpress.XtraRichEdit.API.Native.Section sApp = wordProcessor.Document.Sections[richEditControl.Document.Sections.Count - 1];
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
#region #ModifyHeader
document.AppendSection();
Section firstSection = document.Sections[0];
wpf-richedit-document-api/CS/DXRichEditControlAPISample/CodeExamples/HeaderAndFooterActions.cs#L32
#region #ModifyHeader
document.AppendSection();
Section firstSection = document.Sections[0];
word-document-api-examples/CS/CodeExamples/HeaderAndFooterActions.cs#L40
// Append a new section to the document.
document.AppendSection();
word-processing-merge-documents-with-different-headers-and-footers/CS/Helpers/DocumentsMerger.cs#L28
targetDoc.AppendSection();
targetServer.SaveDocument(outputFileName, DocumentFormat.OpenXml);
winforms-richedit-document-api/VB/RichEditAPISample/CodeExamples/HeaderAndFooter.vb#L28
#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
' #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
targetDoc.AppendSection()
targetServer.SaveDocument(outputFileName, DocumentFormat.OpenXml)
word-document-api-examples/VB/CodeExamples/HeaderAndFooterActions.vb#L34
' Append a new section to the document.
document.AppendSection()
' Access the first document section.
See Also