View Single Post
  #4   Report Post  
Daiya Mitchell
 
Posts: n/a
Default

One option:
Forget about your macro.

Create a list in Excel numbered 1-80 (plus whatever your custom data is).
Use that as the data source for the mail merge.


On 5/18/05 7:38 AM, "cjobes" wrote:

Well, I don't see how I could implement the code with mail merge. Any idea?

"Suzanne S. Barnhill" wrote in message
...
The usual way to create multiple sheets of labels is with a mail merge.

--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA
Word MVP FAQ site: http://word.mvps.org
Email cannot be acknowledged; please post all follow-ups to the newsgroup

so
all may benefit.

"cjobes" wrote in message
...
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