I have many tables in a document some of which will be deleted if they're not needed. Those that are needed will have rows added with thier cells filled.
I am able to use Bookmarks to delete tables and add rows but I can't figure how to fill certain rows in a certain table.
I don't want to use anything like ActiveDocument.Tables(6).Cell(2, 2). I want to be able to identify(and fill) a cell by using a table name.
Is this possible and if so please help me accomplish this?
Here's a couple snippets of what I have so far to add rows and delete a table:
I am able to use Bookmarks to delete tables and add rows but I can't figure how to fill certain rows in a certain table.
I don't want to use anything like ActiveDocument.Tables(6).Cell(2, 2). I want to be able to identify(and fill) a cell by using a table name.
Is this possible and if so please help me accomplish this?
Here's a couple snippets of what I have so far to add rows and delete a table:
Code:
Dim oRows As Range
If AppWd.ActiveDocument.Bookmarks.Exists("TableToAddRowTo1") Then
Set oRows = AppWd.ActiveDocument.Bookmarks("TableToAddRowTo1").Range
oRows.Rows.Add
End If
If AppWd.ActiveDocument.Bookmarks.Exists("TableToDelete1") Then
Set oRows = AppWd.ActiveDocument.Bookmarks("TableToDelete1").Range
oRows.Rows.Delete
End If