Moving a Table to a different page using VBA

  • Thread starter Michael J. Strickland
  • Start date
M

Michael J. Strickland

Is there a way to move a table to a different page using VBA?

I can set the Vertical position with:
tbl.Rows.VerticalPosition = ...

but this only moves the table on its current page.
 
D

Doug Robbins - Word MVP

Pages in Word are not a very static feature, especially if you go moving
things about. However if the Range of the position where you want the table
to appear is identified, you can certainly use code to Cut the table from
its present position and Paste it into that Range.

For example, the following code will move the first table a document from
its present position to the end of the document:

Dim newlocation As Range
With ActiveDocument
Set newlocation = .Range
newlocation.Collapse wdCollapseEnd
.Tables(1).Range.Cut
newlocation.Paste
End With


--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP, originally posted via msnews.microsoft.com
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top