I am using a word document to build a report. I want to add several tables at the end of the report and plan to use a visual basic program to build the tables and insert data. Right now I am building the tables with a macro in word that I will insert into the visual basic program after getting it to work correctly. I am having trouble selecting a table once more than one table is built. When the macro gets to the following code it gives me a "The requested member of the collection does not exist" error. Why does word think there is not a table 2 when I just have it check to see how many tables are in the document?
K = ActiveDocument.Tables.Count
Selection.Tables(K).Select
K = ActiveDocument.Tables.Count
Selection.Tables(K).Select