officefileapi-devexpress-dot-xtrarichedit-dot-api-dot-native-dot-mailmergeoptions-95a80a39.md
Gets or sets how the merged ranges are delimited in the resulting document.
Namespace : DevExpress.XtraRichEdit.API.Native
Assembly : DevExpress.RichEdit.v25.2.Core.dll
NuGet Package : DevExpress.RichEdit.Core
MergeMode MergeMode { get; set; }
Property MergeMode As MergeMode
| Type | Description |
|---|---|
| MergeMode |
An enumeration value that indicates the delimiter.
|
Available values:
| Name | Description |
|---|---|
| NewParagraph |
Specifies that the next merged range starts with a new paragraph.
| | NewSection |
Specifies that the next merged range starts with a new section. The section break type is obtained from the previous section break or set to the NextPage by default. For headers and footers, it is the only allowed option.
| | JoinTables |
Enables you to join rows, which result from a mail merge involving a table with merged fields, into a whole table.
|
If a merge field is located in a document’s header or footer , the MergeMode should be set to MergeMode.NewSection for proper operation.
The following code snippets (auto-collected from DevExpress Examples) contain references to the MergeMode property.
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-control-mail-merge/CS/MailMerge/Form1.cs#L29
myMergeOptions.LastRecordIndex = 3;
myMergeOptions.MergeMode = MergeMode.NewSection;
word-document-api-create-master-detail-report/CS/Program.cs#L51
// Each merged record starts in a new section, preserving page setup and headers/footers per record.
myMergeOptions.MergeMode = MergeMode.NewSection;
wordProcessor.CalculateDocumentVariable += WordProcessor_OnCalculateDocumentVariable;
winforms-richedit-use-images-in-mail-merge/CS/Form1.cs#L43
MailMergeOptions options = richEditControl1.Document.CreateMailMergeOptions();
options.MergeMode = MergeMode.NewSection;
string fileName = System.IO.Directory.GetCurrentDirectory() + @"MailMergeResult.rtf";
winforms-richedit-use-calculatedocumentvariable-event-to-insert-formatted-content/CS/Form1.cs#L33
MailMergeOptions myMergeOptions = richEditControl1.Document.CreateMailMergeOptions();
myMergeOptions.MergeMode = MergeMode.NewParagraph;
how-to-use-docvariable-fields/CS/DocumentVariablesExample/Form1.cs#L36
MailMergeOptions myMergeOptions = richEditControl1.Document.CreateMailMergeOptions();
myMergeOptions.MergeMode = MergeMode.NewSection;
this.Cursor = Cursors.WaitCursor;
winforms-richedit-control-mail-merge/VB/MailMerge/Form1.vb#L26
myMergeOptions.LastRecordIndex = 3
myMergeOptions.MergeMode = MergeMode.NewSection
winforms-richedit-use-images-in-mail-merge/VB/Form1.vb#L36
Dim options As MailMergeOptions = richEditControl1.Document.CreateMailMergeOptions()
options.MergeMode = MergeMode.NewSection
Dim fileName As String = System.IO.Directory.GetCurrentDirectory() & "MailMergeResult.rtf"
winforms-richedit-use-calculatedocumentvariable-event-to-insert-formatted-content/VB/Form1.vb#L27
Dim myMergeOptions As MailMergeOptions = richEditControl1.Document.CreateMailMergeOptions()
myMergeOptions.MergeMode = MergeMode.NewParagraph
Dim server As RichEditDocumentServer = New RichEditDocumentServer()
how-to-use-docvariable-fields/VB/DocumentVariablesExample/Form1.vb#L36
Dim myMergeOptions As MailMergeOptions = richEditControl1.Document.CreateMailMergeOptions()
myMergeOptions.MergeMode = MergeMode.NewSection
Cursor = Cursors.WaitCursor
winforms-richedit-create-a-master-detail-report/VB/RichEditMasterDetailMailMerge/Form1.vb#L108
Dim options As MailMergeOptions = detailRichEdit.CreateMailMergeOptions()
options.MergeMode = MergeMode.JoinTables
options.LastRecordIndex = 10
See Also