Home |
Search |
Today's Posts |
#1
|
|||
|
|||
How can I generate additional pages
Hi everybody,
I'm stuck with a problem. We have a 1-page template that has 80 costum labels on it. I wrote a macro in VB that will fill in the info as needed. I am trying to create a continues number scheme based on the user imput. The VB script works fine for the first page but if the user needs more than 80 numbers I can't find a way to add a second page. When I issue a wdPageBreak it's just an empty space without the labels. Can anybody tell me what I need to do to get a second, third, etc page with the labels? Thanks for your help Claus Below is the code that I'm using Dim Client As String Dim stNum As Integer Dim test As String Dim pages As Integer Selection.HomeKey Unit:=wdStory Selection.MoveRight Unit:=wdCharacter, Count:=1, Extend:=wdExtend Selection.Delete Unit:=wdCharacter, Count:=1 Client = InputBox("Please enter Client name") stNum = CInt(InputBox("Please enter 1st client file number")) pages = CInt(InputBox("Please enter the number of pages")) Client = Client + "-" Selection.HomeKey Unit:=wdStory i = stNum While pages 0 While i stNum + 80 If i 10 Then test = "00000" If i 10 And i 100 Then test = "0000" If i 100 And i 1000 Then test = "000" If i 1000 And i 10000 Then test = "00" If i 999999 Then test = "0" Selection.TypeText Text:=Client + test Selection.TypeText Text:=CStr(i) Selection.MoveRight Unit:=wdCharacter, Count:=2 i = i + 1 Wend Selection.InsertBreak Type:=wdPageBreak pages = pages - 1 Wend End Sub |
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 |