Free Support Forum - aspose.com

Required Guidance to Merge a Word Document for Different Regions

Dear Sir,

This is Amit Dangre. I need a guidance on merging a region in a word document , so rows in the region will be created dynamically. I read the article on mail merge with region explained but when i try to merge a field in the document with different view it gives me error since that view doesnt contain fields to be merged in other section of the documents. Kindly find the attached document where i have to merge a section (Qualification Details dynamically)

So kindly revert asap on how to merge document using different views simultaneously.


This message was posted using Page2Forum (attachment) from Mail Merge with Regions Explained - Aspose.Words for .NET and Java

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

Thanks for your request. Could you please attach your template document for testing? Also please read the following article to learn how to prepare template document.

http://www.aspose.com/documentation/file-format-components/aspose.words-for-.net-and-java/preparing-a-document.html

Also please see the following code and attached documents.

//Create DataTable

DataTable info = new DataTable("Info");

//Add columns

info.Columns.Add("FirstName");

info.Columns.Add("LastName");

info.Columns.Add("Company");

//Add rows

info.Rows.Add(new object[] { "Alexey", "Noskov", "Aspose" });

info.Rows.Add(new object[] { "Den", "Michel", "Nicon" });

//Open template document

Document doc = new Document(@"Test153\in.doc");

//Execute maeil merge

doc.MailMerge.ExecuteWithRegions(info);

//Save output document

doc.Save(@"Test153\out.doc");

Best regards.