SnapMailMergeExportOptions.CustomSeparator Property
Returns a custom separator that is inserted between each pair of master sections in a mail-merge document.
Namespace: DevExpress.Snap.Core.Options
Assembly: DevExpress.Snap.v18.2.Core.dll
Declaration
Property Value
Type | Description |
---|---|
SnapDocument | A SnapDocument object. |
Property Paths
You can access this nested property as listed below:
Object Type | Path to CustomSeparator |
---|---|
MailMergeExportFormShowingEventArgs |
|
Remarks
Use the CustomSeparator property to access a custom record separator that is enabled when the SnapMailMergeExportOptions.RecordSeparator property is set to Custom.
Example
This code snippet illustrates how to handle the SnapControl.MailMergeExportFormShowing event and specify the SnapMailMergeExportOptions.RecordSeparator and SnapMailMergeExportOptions.CustomSeparator
properties to change the separator that is inserted between each pair of master sections.
Note
A complete sample project is available at https://github.com/DevExpress-Examples/how-to-provide-custom-separators-between-records-in-a-merged-document-e5073
// Provide a user interface to select a custom separator.
private void snapControl1_MailMergeExportFormShowing(object sender, MailMergeExportFormShowingEventArgs e) {
SnapMailMergeExportOptions eOptions = e.Options;
MailMergeExportFormControllerParameters controllerParameters =
new MailMergeExportFormControllerParameters(this.snapControl1, eOptions);
eOptions.RecordSeparator = RecordSeparator.Custom;
e.Handled = true;
using (MyMailMergeExportForm mergeForm =
new MyMailMergeExportForm(controllerParameters)) {
mergeForm.LookAndFeel.ParentLookAndFeel = this.snapControl1.LookAndFeel;
e.DialogResult = mergeForm.ShowDialog(this);
switch (mergeForm.SeparatorType) {
case MyMailMergeExportForm.SeparatorTypeEnum.Html:
eOptions.CustomSeparator.HtmlText = mergeForm.HtmlSeparator;
break;
case MyMailMergeExportForm.SeparatorTypeEnum.RichText:
eOptions.CustomSeparator.Text = string.Empty;
eOptions.CustomSeparator.AppendDocumentContent(
mergeForm.RichSeparator.Range);
break;
}
}
}