Files to look at:
- Program.cs (VB: Program.vb)
This example demonstrates how to use the Spreadsheet Mail Merge functionality to automatically generate a document based on data retrieved from an object data source.
The mail merge template is created in code when the application starts. The data source is specified using the Workbook.MailMergeDataSource property. The Workbook.GenerateMailMergeDocuments method accomplishes mail merge and returns the resulting workbook. Since the mail merge mode is set to Multiple Sheets, all worksheet created by the GenerateMailMergeDocuments method are contained in a single workbook.