Home |
Search |
Today's Posts |
|
#1
|
|||
|
|||
Hi Cjobes,
What I'm looking for is help how to add as many pages in the code as needed with those 80 boxes. When I issue a wdPageBreak only a blank page comes up. I'm a DB and App guy and haven't work much with Word automation. So, I figure you have no problems calculating how many additional pages you need :-)? Just subtract the start number from the end number, then divide by 80; and then the result minus one... Have you done some experimenting, manually, to determine if you get a desirable result if you, for example, insert a manual page break, copy the table (labels) and paste on a new page? Or does simply copying/pasting the label sheet at the end of the first set of labels generate what you need? Anyway, as soon as you determine the best way... Select the current page of labels and create an AutoText entry from them. The AutoText needs to be saved in a template. All you need to do in your code, then, is insert the AutoText (and any required page break kind of thing) in a loop as many times as you need additional pages. This is much more reliable than trying to copy/paste in the code. And I still advise you to insert the SEQ field into the label pages, so that you don't need to worry about doing the numbering in your code. 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 :-) |
#2
|
|||
|
|||
Thanks Cindy (Dankeschoen)
I will experiment with this a bit further. I visited your site and had a look at the SEQ stuff. When you look at my code you will see that the numbering has to be in a certain way. It always has to be 6 ditgets with the right number of leading 0s. This is very easy to do in the code and I get away with a single field. 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. Thanks again for answering... Herzliche Gruesse in die Schweiz, Claus "Cindy M -WordMVP-" wrote in message news:VA.0000adc6.00805881@speedy... Hi Cjobes, What I'm looking for is help how to add as many pages in the code as needed with those 80 boxes. When I issue a wdPageBreak only a blank page comes up. I'm a DB and App guy and haven't work much with Word automation. So, I figure you have no problems calculating how many additional pages you need :-)? Just subtract the start number from the end number, then divide by 80; and then the result minus one... Have you done some experimenting, manually, to determine if you get a desirable result if you, for example, insert a manual page break, copy the table (labels) and paste on a new page? Or does simply copying/pasting the label sheet at the end of the first set of labels generate what you need? Anyway, as soon as you determine the best way... Select the current page of labels and create an AutoText entry from them. The AutoText needs to be saved in a template. All you need to do in your code, then, is insert the AutoText (and any required page break kind of thing) in a loop as many times as you need additional pages. This is much more reliable than trying to copy/paste in the code. And I still advise you to insert the SEQ field into the label pages, so that you don't need to worry about doing the numbering in your code. 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 :-) |
#3
|
|||
|
|||
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 :-) |
#4
|
|||
|
|||
Cindy,
Thanks, that worked like a charme. I added some code to calculate how many pages are needed, run a loop to create them and then insert the numbers. 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 :-) |
#5
|
|||
|
|||
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 :-) |
#6
|
|||
|
|||
Hi Claus,
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. Glad you're finally up and running :-) Cindy Meister |
Reply |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Page Numbering - Insertion Pages | Microsoft Word Help | |||
Printing Page Ranges with page numbers i-iv then 1-23 for 27 total | Page Layout | |||
Number of pages excluding content pages | Microsoft Word Help | |||
Printing single pages or a range of pages | Mailmerge | |||
Can I add additional pages after my endnotes in one document? | Page Layout |