Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

RichEditControl.MailMergeRecordFinished Event

Fires after each data record is merged with the document in the mail merge process.

Namespace: DevExpress.XtraRichEdit

Assembly: DevExpress.XtraRichEdit.v24.2.dll

NuGet Package: DevExpress.Win.RichEdit

#Declaration

public event MailMergeRecordFinishedEventHandler MailMergeRecordFinished

#Event Data

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

Property Description
Cancel Gets or sets a value indicating whether the event should be canceled. Inherited from CancelEventArgs.
Document Gets a merged document.
RecordDocument Gets a template document after a record is merged.
RecordIndex Gets an index of a record currently merged.

#Remarks

The MailMergeRecordFinished event can be used to post-process the merged section of a document that corresponds to a particular record. The following code snippet demonstrates that, after each record is merged, a custom footer is appended.

View Example

private void richEditControl1_MailMergeRecordFinished(object sender, MailMergeRecordFinishedEventArgs e) {
    e.RecordDocument.AppendDocumentContent("Docs\\bungalow.docx", DocumentFormat.OpenXml);
}
See Also