I have a word file template (FileA.docx). It has a specific table (TableA)which either needs to be filled using an excel VBA listbox or I need to give the user an option to select another word file(e.g. FileB.docx). The entire content of the FileB.docx should replace the table in FileA.docx.
I have the code to insert data from listbox in the existing table. But the second option of inserting content from other word file is not working as required.
I have bookmarked the whole TableA, including two lines above and below it as "Annex1"
The FileB.docx also has a table. When the below code runs it copies the content of FileB but the table there loses its format and gets pasted as normal lines in FileA like below. How do I fix this?
Annexure 1: Title
Sr.No.
Area
Sub-area
1
Sample Area 1
Sample Sub Area 1
Sample Sub Area 2
Sample Sub Area 3
2
Sample Area 2
Sample Sub Area 1
Sample Sub Area 2
Sample Sub Area 3
Sample Sub Area 1
Sample Sub Area 2
Sample Sub Area 3
3
Sample Area 3
Sample Sub Area 1
Sample Sub Area 2
Sample Sub Area 3
Sample Sub Area 1
Bookmarks