how do I set up to start printing at label other than first

I

Irish-woman

I want to create a mail merge document that will start printing labels on
some label other than the first one - to use up partially printed label
pages. Of course I can merge to a document, cut out the first serveral
labels and paste them at the end, but isn't there smoother way?
 
D

Doug Robbins - Word MVP

If you run the following macro when you have setup your label type mailmerge
main document, it will ask you how many labels have been used on the first
sheet and then it will insert the necessary number of blank records into the
data source and then execute the merge to a new document which you can then
print out onto your labels.

It is designed for use when the data source is a table in a Word document.
If your datasource is in some other format, use a catalog or directory type
mailmerge to get it into the form of a Word document and use that Word
document instead of your original data source.

Macro to set the first label on a part sheet of labels for a label type
mailmerge.
Dim MMMDoc As Document
Dim dsource As Document
Dim dtable As Table
Dim i As Long, j As Long
Set MMMDoc = ActiveDocument
With MMMDoc.MailMerge
If .MainDocumentType = wdMailingLabels Then
If .State = wdMainAndDataSource Then
Set dsource = Documents.Open(.DataSource.Name)
Set dtable = dsource.Tables(1)
i = InputBox("Enter the number of labels that have already been
used on the sheet.", "Set Starting Label")
If IsNumeric(i) Then
With dtable
For j = 1 To i
.Rows.Add BeforeRow:=.Rows(2)
Next j
End With
End If
.Destination = wdSendToNewDocument
.Execute
End If
End If
End With
dsource.Close wdDoNotSaveChanges

--
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
 
J

jcrompto

Thank you for the info. I tried to run the macro, and it's giving me a
syntax error message at the line i = InputBox...

Can you troubleshoot this?

Thank you!
 
D

Doug Robbins - Word MVP

i = InputBox("Enter the number of labels that have already been used on the
sheet.", "Set Starting Label")



The above command needs to be all on one line. The mail program as probably
inserted a line break which is not a proper vba line break character.
Place the cursor at the beginning of the line following the i = and press
the backspace key to get it all on one line.
--
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
 
J

jcrompto

Excellent, thank you!

Doug Robbins - Word MVP said:
i = InputBox("Enter the number of labels that have already been used on the
sheet.", "Set Starting Label")



The above command needs to be all on one line. The mail program as probably
inserted a line break which is not a proper vba line break character.
Place the cursor at the beginning of the line following the i = and press
the backspace key to get it all on one line.
--
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
 

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