This is driving me insane, from Excel I have opened an existing Word Doc, it contains 4 tables and from AFTER the last Bookmark
to the end of the document there is an unknown amount of text.
I want to deleted Table 1 but leave 2,3 &4 then delete all the unknown amount of text that is after the last Bookmark . I am struggling
with the part of; identifying/selecting from last bookmark to end of the document.
I have spent hours reading and trying different things all with different results, but ultimately none have worked.
As a bit of a side question; just how different is vba for Excel than vba for Word and what are the limitations of controlling Word from Excel, is it just a case of terminology.
Dim wd As Word.Application
Dim wdDoc As Word.Document
Dim WdRange As Word.Range
Set wd = New Word.Application
Set wdDoc = wd.Documents.Open("C:\***************.docx")
wd.Visible = True
Set WdRange = wdDoc.Bookmarks("****************").Range
WdRange.Tables(1).Delete ‘This deletes the 1st table
‘ Tables 2,3 &4 will not be deleted
‘ Now delete all Text After Table 4 to end of Document
If you can help me regain my sanity I would really appreciate it.
Bookmarks