Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Copy Table in Word

Status
Not open for further replies.

wuxapian

Programmer
Jun 13, 2001
52
0
0
GB
Hi,

I am building a document in word to print labels. I have a table on the first page and I want to be able to copy that table onto a new page (endlessly depending on the number of labels to be printed.)

Does anyone know how to programatically duplicate a table?

TIA
Wux.
 
Hi wuxapian,

Errmmm ... Copy and Paste?

You need some way to identify your table - in your case it sounds like ..

Code:
ActiveDocument.Tables(1).Range.Copy

.. should do it, and some way to identify the destination, perhaps ..

Code:
Selection.Paste

Enjoy,
Tony

------------------------------------------------------------------------------------------------------
We want to help you; help us to do it by reading FAQ222-2244 before you ask a question.
 
Thanks for your reply,

I have tried copying and pasting the table but once the table has been pasted you cannot refer to it in the tables array so I assume that it does not copy the actual table object.

I need to be able to refer to the table i.e.
ThisDocument.Tables(2)

Wux.
 
Hi Wux,

You should be able to do that, but if you paste a table immediately after another table, the two will be merged into one - you must have at least a character (paragraph mark for example) between them.

Enjoy,
Tony

------------------------------------------------------------------------------------------------------
We want to help you; help us to do it by reading FAQ222-2244 before you ask a question.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top