Hi Noob here,
Document doc = new Document(MyDir + "Issue.doc");
// Duplicate the third last section and insert it after it
Section newSection = (Section)doc.Sections[doc.Sections.Count - 3].Clone(true);
doc.InsertAfter(newSection, doc.Sections[doc.Sections.Count - 3]);
doc.Save(MyDir + "Out.docx");
Hi Tahir,
Thanks for your reply, but as I am not writing fresh code for this, but I am doing maintenance for this one and I need to add a new record for a new coverage. So generating the document afresh programmatically is out of scope for me.
Let me explain the scenario once again:
I have a word template, part of which is Issue.doc that I shared. My VB.Net program reads the document and inserts the values for all fields (amount of different coverage). Then there is one logic which reads all the fields and removes the coverage table (entire row) which has $0 amount.
Issue I am facing is that when I try to insert a new table type row it is getting merged with the row behind it. If you refer the attached document, there is one table showing all “Coverage and Premiums” ; in that I need to add a coverage after Dwelling (Coverage A) and it should be a table type row.
Can you help me in that?
Thanks,
Thank you all who’ve tried to help me. I’ve found a solution of this problem. Below are the steps that I did to insert a new row which should be a table type row.
1. Click on the row after which you want to insert a new record.
2. insert a new record.
3. click on the new record then click on page layout menu and insert a section break.
This did the trick for me.
Thanks all
Mods: You can please mark the post as resolved/closed.