We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Aspose Word Template MailMerge

I am creating a word document template using mailmerge.
this attach template i have 2 column value in my datatable c#.
i try to merge datatable value to my mailmerge template.
but not created this attach type template.
so please provide the solution how to mailmerge this type of template using Aspose.word c#.

I Want to this type output aspose word template mailmerge c#.png (26.6 KB)


Please see these input/output word documents (ExecuteWithRegions-template.docx and 18.8.docx) and try running the following code:
ExecuteWithRegions-template.zip (18.6 KB)

DataTable dataTable = new DataTable("tbl");

dataTable.Columns.Add(new DataColumn("col1"));
dataTable.Columns.Add(new DataColumn("col2"));

DataRow dataRow;
for (int i = 1; i < 5; i++)
    dataRow = dataTable.NewRow();
    dataRow[0] = "column 1_" + i;
    dataRow[1] = "column 2_" + i;


Document doc = new Document("D:\\Temp\\ExecuteWithRegions-template.docx");


Hope, this helps.