Mail Merge Labels

Is there a way to start a mail merge in the middle of the document for when you have a used labels?

Answer
Answer

The following macro will work with any data source; it does so by modifying the mailmerge output and inserting however many empty rows of labels are required. With this approach, you should never lose more than a few unused labels - from a partly-used row.

Sub MailMergeToDoc()
Application.ScreenUpdating = False
Dim i As Long, j As Long
j = CLng(InputBox("How many rows of labels have been used on the first sheet?", "Skip used labels"))
ActiveDocument.MailMerge.Execute
With ActiveDocument
  For i = .Tables.Count To 2 Step -1
    .Tables(i).Range.Characters.First.Previous.Delete
  Next
  With .Tables(1)
    For i = .Rows.Count To 1 Step -1
      If Len(.Rows(i).Range.Text) = .Rows(i).Cells.Count * 2 + 2 Then
        .Rows(i).Delete
      End If
  Next i
  .Rows.AllowBreakAcrossPages = False
  For i = 1 To j
    .Rows.Add .Rows(1)
  Next
  End With
  '.PrintOut
  '.Close False
End With
Application.ScreenUpdating = True
End Sub

Note: You need to send the merge output to a new document, not direct to printer, but it can be printed from there. To automate that and have the merge perform like a merge to print, un-comment the lines:
  '.PrintOut
  '.Close False

Cheers
Paul Edstein
(Fmr MS MVP - Word)

Was this reply helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

 
 

Question Info


Last updated October 5, 2021 Views 80 Applies to: