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

Free Support Forum - aspose.com

Word mergefield doubt

i am new to aspose i have a doubt

how can i display a set of values using a single merge field

Hi<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Thank you for your interest in Aspose.Words. I think that you can use mail merge with regions. Please see the following links to learn more:



Hope this helps.

Best regards.

hi alex,

thank u for kind suggestion, but mine requirement is different

can i itterate the same executeregion method with different argument,

i tried that but it does not shown me all the possible result , instead it just shown me a single result in a single page

Hi<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Thanks for your inquiry. I created small demo for you. See the following code and attached documents.

//Create DataTable that will be used as data source for mail merge

DataTable clientInfo = new DataTable("clientInfo");

//Add columns to dattaTable





//Insert some data into the datatable

clientInfo.Rows.Add(new object[] { "Alexey", "Noskov", "Aspose", "<?xml:namespace prefix = st1 ns = "urn:schemas-microsoft-com:office:smarttags" />Auckland" });

clientInfo.Rows.Add(new object[] { "John", "Smith", "Microsoft", "Los Angeles" });

clientInfo.Rows.Add(new object[] { "Jain", "Martin", "IBM", "London" });//etc...

//Open first template (without regions)

Document doc = new Document(@"Test312\in_withoutRegions.doc");

//Execute simple mail merge

//Data from each row will be placed on the separate page


//Sace result document


//Open enother template (with regions)

Document doc1 = new Document(@"Test312\in_withRegions.doc");

//Execute mail merge with regions

//Data from each row will be placed on the single page(without breaks)


//Save result document


Also please attach your template and create the result document manually to show me how the output should look. I will try to help you.

Best regards.