View Single Post
 
Old 08-18-2019, 06:53 AM
sts023 sts023 is offline Windows 7 64bit Office 2010
Hopeless Idiot
 
Join Date: Apr 2019
Location: God's Own County
Posts: 26
sts023 is on a distinguished road
Default Inserting a Table using VBA

Hi guys...
I have a document on which there is a specific table.
I want to copy that table "as is" to another document, but WITHOUT using the clipboard.
I can save the table in a variable Dim'd as Word.Table, but I dont know how to insert that table into another document.
I can't find an "Activedocument.Tables.Insert" with a table as an operand; all I've found is the "ActiveDocument.Tables.Add", which doesn't seem to have the facility to have a table variable as an operand.
I know I could extract the dimensions, formats and contents and use those details to "Add" and then populate the new table, but that's one great lump of coding I'd like to avoid.
Surely if I can code
Code:
Dim tbl                     As Word.Table
  Set tbl = ActiveDocument.Tables(1)
then there must be something like
Code:
Dim tbl                     As Word.Table
  ActiveDocument.Tables.insert(tbl)
isn't there?
Can ayone help?
Reply With Quote