Skip to main content
A newer version of this page is available.

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.v19.1.Core.dll

Declaration

SnapDocument CustomSeparator { get; }

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
.Options.CustomSeparator

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.

// 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;
        }
    }
}
See Also