V
VBA Coder
Does anyone know how I can insert a Table in a Bookmark using VBA?
I have the following code that inserts a table at the bookmark, however,
each time I run my Macro to insert the table, I get a new table placed
inside the 1st table's first cell. I need the bookmark to be cleared out
(ie: Table removed) each and every time I run my Macro.
Dim rRange As Range, myTable As Table
ActiveDocument.Bookmarks("TableBookmark").Select
Selection.Collapse Direction:=wdCollapseStart
Set myTable = ActiveDocument.Tables.Add(Range:=Selection.Range, _
NumRows:=6, NumColumns:=3)
myTable.AutoFormat Format:=wdTableFormatClassic2
I have the following code that inserts a table at the bookmark, however,
each time I run my Macro to insert the table, I get a new table placed
inside the 1st table's first cell. I need the bookmark to be cleared out
(ie: Table removed) each and every time I run my Macro.
Dim rRange As Range, myTable As Table
ActiveDocument.Bookmarks("TableBookmark").Select
Selection.Collapse Direction:=wdCollapseStart
Set myTable = ActiveDocument.Tables.Add(Range:=Selection.Range, _
NumRows:=6, NumColumns:=3)
myTable.AutoFormat Format:=wdTableFormatClassic2