Mailmerge condition to next label

Posted on 2011-05-10
Last Modified: 2013-11-05
I have a mailmerge between word 2010 and an excel spreadsheet. Each record in the spreadsheet includes a quantity field in which I wish to print that particular label the specified number of times before going to the next label.

What do I have to do to print a label based on the quantity of labels before going to the next label? A specific example is appreciated.
Question by:swanzey
    LVL 76

    Expert Comment

    I think that the easiest way would be to create a new sheet that has a row for each instance of each required label.

    Author Comment

    But isn't there a way to use nextif while decrementing the qty counter or something?

    LVL 76

    Expert Comment

    I have considered running the MailMerge under VBA control, but I can see snags in the case of labels. It might be possible using arithmetic in Word Fields.

    I'll look again at each approach, but, as I said, creating a new sheet especially for the merge would seem to be the simplest way.
    LVL 76

    Expert Comment

    I've tried VBA. I works in producing the correct number of labels, but each one is the first on a new page of labels.
    Sub MultiLabels(wdDoc As Word.Document)
        Dim r As Integer
        Dim LabelCount As Integer
        With wdDoc.MailMerge
            .MainDocumentType = wdMailingLabels
            .Destination = wdSendToNewDocument
            For r = 1 To .DataSource.RecordCount
                .DataSource.LastRecord = r
                .DataSource.FirstRecord = r
                LabelCount = .DataSource.DataFields("Count").Value
                Do While LabelCount > 0
                    LabelCount = LabelCount - 1
            Next r
        End With
    End Sub

    Open in new window

    LVL 76

    Accepted Solution

    We can store the count value in a bookmark

    SET bmkLabelCount { MERGEFIELD COUNT }

    and test it

    {NEXTIF  bmkLabelCount  = 0 }

    but I can't see a way of decrementing it for each label that is printed

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    IT, Stop Being Called Into Every Meeting

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    Suggested Solutions

    Title # Comments Views Activity
    Microsoft Paint 10 47
    Text wrapping issue with Word 14 33
    *Best* PDF to Word Convertor 4 61
    how to link excel with word 6 29
    Do you ever need to create a 20 page Word document for some testing purpose? Are you tired of copying & pasting old boring "lorem ipsum" text over and over again, increasing font size and line space in order to make the document 20+ pages long? Look…
    Like many others, we try and discourage users from printing documents unnecessarily and instead send or share them electronically. However, this doesn't always work and documents are still printed. With this simple solution, if the user tries to …
    This video walks the viewer through the process of creating an MLA formatted document, as well as a bibliography with citations.
    In a previous video Micro Tutorial here at Experts Exchange (, I explained how to get a free, one-month trial of Office …

    737 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    22 Experts available now in Live!

    Get 1:1 Help Now