View Single Post
 
Old 06-04-2015, 02:09 PM
bgmsd bgmsd is offline Windows 7 32bit Office 2010 32bit
Novice
 
Join Date: Jun 2015
Posts: 6
bgmsd is on a distinguished road
Default Iterating through tables to find a bookmark

Hello all. I think that this should be fairly easy to do, but I cannot find the answer anywhere. I have a document with several tables in it, and each table has a unique bookmark name. From Access, I want to loop through all tables in my word document and look for a particular table with a certain bookmark name. Lets say that the bookmark name of the table is MyTable. I am writing some sample code below, but I know that it isn't correct. What is the correct structure?

Code:
 
For Each tbl In doc.Tables
        If tbl.Rows.Count > 1 And tbl.Range.Bookmark.Text = "MyTable" Then
Thanks,

David
Reply With Quote