The mail merge functionality provided by the DevExpress ASP.NET MVC Rich Text Editor (RichEdit extension) enables you to bind the control to an external data source (or a Model) and then preview dynamic content right in the opened template document, prior to performing the final mail merge. This feature can be useful for a variety of business requirements, such as composing, previewing and generating catalogs, reports, or personalized letters.
To bind to a data source, the BindToXML method can be used (or the Bind method - to bind to a Model). When the mail merge data source is attached, end-users can use ribbon commands of the Mail Merge tab to visually insert mail merge fields (placeholders for the dynamic content) from the bound data source, navigate through data source records to preview merged data and initiate the mail merge. The resulting merged document can be generated for all or specific data source records and saved to a server folder or downloaded by a client.
The RichEdit also provides a specific API allowing you to control mail merge operations programmatically.
- The ViewMergedData property specifies whether to display field results or field codes in a mail-merge document.
- The MailMerge method (with a set of overloads) initializes the mail merge process and generates the resulting document containing the merged information.
- The CreateMailMergeOptions method creates an object for specifying the options used in mail merge operations.