Back to Devexpress

RichEditControl.MailMergeRecordFinished Event

windowsforms-devexpress-dot-xtrarichedit-dot-richeditcontrol-8b67068b.md

latest3.1 KB
Original Source

RichEditControl.MailMergeRecordFinished Event

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

Namespace : DevExpress.XtraRichEdit

Assembly : DevExpress.XtraRichEdit.v25.2.dll

NuGet Package : DevExpress.Win.RichEdit

Declaration

csharp
public event MailMergeRecordFinishedEventHandler MailMergeRecordFinished
vb
Public Event MailMergeRecordFinished As MailMergeRecordFinishedEventHandler

Event Data

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

PropertyDescription
CancelGets or sets a value indicating whether the event should be canceled. Inherited from CancelEventArgs.
DocumentGets a merged document.
MailMergeRegionInfoObtains information on the currently merged region.
RecordDocumentGets a template document after a record is merged.
RecordIndexGets 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

csharp
private void richEditControl1_MailMergeRecordFinished(object sender, MailMergeRecordFinishedEventArgs e) {
    e.RecordDocument.AppendDocumentContent("Docs\\bungalow.docx", DocumentFormat.Docx);
}
vb
Private Sub richEditControl1_MailMergeRecordFinished(ByVal sender As Object, ByVal e As MailMergeRecordFinishedEventArgs) Handles richEditControl1.MailMergeRecordFinished
    e.RecordDocument.AppendDocumentContent("Docs\bungalow.docx", DocumentFormat.Docx)
End Sub

See Also

RichEditControl Class

RichEditControl Members

DevExpress.XtraRichEdit Namespace