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

SnapControl.MailMergeExportFormShowing Event

Fires before showing the Export Range form.

Namespace: DevExpress.Snap

Assembly: DevExpress.Snap.v18.1.dll

Declaration

public event MailMergeExportFormShowingEventHandler MailMergeExportFormShowing

Event Data

The MailMergeExportFormShowing event's data class is MailMergeExportFormShowingEventArgs. The following properties provide information specific to this event:

Property Description
DialogResult Gets or sets the return value of a dialog box. Inherited from ShowFormEventArgs.
Handled Gets or sets whether an event was handled. If it was handled, the default actions are not required. Inherited from ShowFormEventArgs.
Options Provides access to the mail merge options of the Export Range dialog window that is invoked when publishing a document.
Parent Gets or sets a parent of the form being shown. Inherited from ShowFormEventArgs.

Remarks

The Export Range dialog window provides a user interface to specify the SnapMailMergeExportOptions. It is invoked after selecting the publishing format of a mail-merge document in the Data Tools: Mail Merge toolbar.

snap-mail-merge-export-range-dialog

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;
        }
    }
}

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the MailMergeExportFormShowing event.

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.

See Also