Hi AtliDev,
Thank you contacting Syncfusion.
On analysing further on the given code snippet, you have merged all the cells in the first row of the second table and removed the last column of the overall table. Based on this we have created a sample application with your code snippet to meet your end requirement.
Please find the modified sample from the below link
https://www.syncfusion.com/downloads/support/forum/150551/ze/GenerateWord-2093121320We have added some modification in the given code snippet. These are,
1. After merging the table cells, we have saved this document as stream.
2. Then, opened this stream as document in the new word document instance.
3. Retrieved the Table from the bookmark content (‘
D_Local’)
4. Removed the last column of table and applied autofit table to content formation
5. Finally saved the new document.
Reason for saving the document after merging the table cells:While saving the document, if the continuous tables are present without any in between paragraph, we consider these tables are same and we merged the both tables as per the Microsoft Word application behaviour. After that, when retrieving the table from the bookmark content, we get single table. So, we can easily remove the last column from the table.
Reason for setting autofit table to content formation:
While setting AutoFit table with respect to content, the table cells are automatically resized based on the content in each cell to avoid deformation of the table
Please let us know if you have any other questions.
Thanks and Regards,
Manikandan Ravichandran