Free Support Forum -

Merging Sections/Regions in a word Document with views

Dear All,

I am trying to merge a word document with views. I want a section of a document to be merged with the first view and another section of document to be merged with second view. So when i see the document using aspose pdf , it will show the contents from different view dynamically. For that i have already used a dataset which will fetch data from two different datatable and later i have to merge the document with those datatables but when i try using this concept it doesnt work.I have used doc.mailmerge.executewithregions(), but still no results.

Please help asap.

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

Thanks for your request. Could you please attach your document and provide me code that will allow me to reproduce this issue?

As an example you can use the following code and attached documents.

//Create DataTable

DataTable info = new DataTable("Info");

//Add columns




//Add rows

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

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

//Create another DataTable

DataTable companyInfo = new DataTable("CompanyInfo");

//Add columns



//Add rows

companyInfo.Rows.Add(new object[] { "Aspose", "Cidney" });

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

//Create DataSet

DataSet ds = new DataSet();

//Add tables



//Open template document

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

//Execute maeil merge


//Save output document


Best regards.

Thanks a lot for your quick support . the issue has been resolved.