View Single Post
  #15   Report Post  
cjobes
 
Posts: n/a
Default

Cindy,

Thanks for your code sample. It worked great. I added a counter and now the
code generates exactly the right number of pages and inserts the text into
the boxes.

Claus


"Cindy M -WordMVP-" wrote in message
news:VA.0000aded.00ef4134@speedy...
Hi Cjobes,

Where my problem starts is generating those additional pages on the fly

and
moving the curser to the right place. I don't know the code for "select
all" - "copy" - "page break" -"paste" etc and to assure that the page

after
the page break has the same margin set. Given that I don't do

bobbin-lace I
will spend some time over the weekend to play with it and see if I find
something on your site to help.

1. Please do experiement manually, along the lines I suggested.

2. Copy/paste is never a good idea, if there's an alternative. If an

AutoText
entry won't work for some reason, then the better approach is to use
Range.FormattedText to bring the table into the new position

3. Cursor position shouldn't matter; you should avoid working with the
Selection object. Use Range, instead. Here's a bit of pseudocode (meaning
it's off the top of my head) that illustrates how you'd "copy" the first
table in a document to the very end of the document:

Dim rngTable as Word.Range
Dim rngTarget as Word.Range

Set rngTable = ActiveDocument.Tables(1).Range
Set rngTarget = ActiveDocument.Range
rngTarget.Collapse wdCollapseEnd
rngTarget.FormattedText = rngTable.FormattedText

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 8 2004)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question or
reply in the newsgroup and not by e-mail :-)