officefileapi-118746-spreadsheet-document-api-mail-merge-mail-merge-overview.md
The Mail Merge functionality enables you to automatically generate a set of documents based on a single template and include unique data values retrieved from a data source into each document. This feature can be useful for a variety of business requirements, such as personalizing letters, and composing catalogs and reports.
To perform a mail merge, you need a template and a data source.
Use the template workbook’s Workbook.MailMergeOptions property to get access to the mail merge options.
The template workbook’s Workbook.GenerateMailMergeDocuments method finalizes the mail merge process. It returns a collection of resulting workbooks (if the Single Sheet or Multiple Sheets mail merge mode is used, the collection will contain a single workbook). You can open the resulting workbook or save it to a file or stream.
See Also