Please Note: This article is written for users of the following Microsoft Word versions: 2007 and 2010. If you are using an earlier version (Word 2003 or earlier), this tip may not work for you. For a version of this tip written specifically for earlier versions of Word, click here: Getting Rid of Blank Labels in a Filtered Merge.

Getting Rid of Blank Labels in a Filtered Merge

Written by Allen Wyatt (last updated April 20, 2018)
This tip applies to Word 2007 and 2010


Peggy experienced a problem printing merged labels from a filtered database. It seems that the labels she wanted were printing out, but the printing was also kicking out a blank label for every record filtered out of the merge.

Quite honestly, this problem should not occur in Word. If you use the standard Mail Merge Wizard, it sets up your labels so that you don't get blanks; you only get the labels you want. If you are not getting that, then the most likely culprit is the actual main document created in Word. You can try this:

  1. Open the main document—the one that you use to merge with your data.
  2. Press Alt+F9. This should display all the field codes in the document.

Merging is accomplished through the use of field codes. If the codes are incorrect, the merging is not done properly. The purpose of the Mail Merge Wizard is to get enough information from you that Word can set up the field codes properly.

When printing labels, the field codes specify where the individual bits of information go that make up each label. Your document should consist of a table, with each cell of the table responsible for a single label. What you are looking for right now is the composition of the first label, in the upper-left corner of your table. This is your base label. Every other cell in the table should look the same as this base label, with the exception of a {NEXT} field at the beginning of the label. This field, when encountered during a merge, causes Word to proceed to the next record in the source data.

If, after examining the field codes for your labels, you discover that they are not the same (with the exception of the {NEXT} field), then you need to start over and use the Mail Merge Wizard to again create your main document.

Another thing to check is the actual filtering that you are doing. If you are filtering your data records based on a non-printing field, it is possible that the filter is not functioning according to your expectations. In fact, it might not be filtering at all, and you can't tell because you never print the field on which you are filtering. Check to make sure that the filter is set up properly.

If you still run into problems, then you could check your source data. For instance, if you are using an Access database as your data source, you could define a query in Access that defines the labels you want to print. Use this query as the data source in Word for your mail merge. Thus, Word is not doing the filtering, but Access is handing Word data that has already been filtered.

Finally, you can get rid of records that have blank fields by using the {NEXTIF} field in your labels. This field code checks the contents of a specific field against a criterion that you set. If the criterion is met, then the merge proceeds to the next record in the data source. Why would you use such a field? It is very helpful if your data source contains a lot of records that are only partial—for instance, you may have data records that record a first name but not a last name. Consider the following field code, which could be placed at the beginning of a label:

{ NEXTIF { MERGEFIELD LastName }= "" }

This checks the LastName merge field, and if it is empty, the record is skipped and Word proceeds to the next record.

WordTips is your source for cost-effective Microsoft Word training. (Microsoft Word is the most popular word processing software in the world.) This tip (11220) applies to Microsoft Word 2007 and 2010. You can find a version of this tip for the older menu interface of Word here: Getting Rid of Blank Labels in a Filtered Merge.

Author Bio

Allen Wyatt

With more than 50 non-fiction books and numerous magazine articles to his credit, Allen Wyatt is an internationally recognized author. He is president of Sharon Parq Associates, a computer and publishing services company. ...

MORE FROM ALLEN

Printing Summary Information from a Macro

Part of the information that Word maintains about each of your documents is a summary statement, which you can define in ...

Discover More

Special Characters In Hyperlinks

Do you use special characters (such as the pound sign) in your worksheet names? If so, you could run into problems ...

Discover More

Stubborn Phantom Paragraphs

When converting documents from WordPerfect to Word, you may run into a problem with what the conversion produces. If you ...

Discover More

Do More in Less Time! Are you ready to harness the full power of Word 2013 to create professional documents? In this comprehensive guide you'll learn the skills and techniques for efficiently building the documents you need for your professional and your personal life. Check out Word 2013 In Depth today!

More WordTips (ribbon)

Attaching Specific Files to Mail-Merge E-Mail Messages

Want to add attachments to each e-mail message created in a mail merge? Word doesn't include the capability to do this, ...

Discover More

Conditionally Adding a Period in a Mail Merge

When merging data into a Word document, you may want to add information to the document based on an evaluation of what is ...

Discover More

Using Mail Merge to Complete Documents

Mail merge can be used to put together groups of documents that rely on common information. This tip shows how mail merge ...

Discover More
Subscribe

FREE SERVICE: Get tips like this every week in WordTips, a free productivity newsletter. Enter your address and click "Subscribe."

View most recent newsletter.

Comments

If you would like to add an image to your comment (not an avatar, but an image to help in making the point of your comment), include the characters [{fig}] (all 7 characters, in the sequence shown) in your comment text. You’ll be prompted to upload your image when you submit the comment. Maximum image size is 6Mpixels. Images larger than 600px wide or 1000px tall will be reduced. Up to three images may be included in a comment. All images are subject to review. Commenting privileges may be curtailed if inappropriate images are posted.

What is five more than 0?

There are currently no comments for this tip. (Be the first to leave your comment—just use the simple form above!)


This Site

Got a version of Word that uses the ribbon interface (Word 2007 or later)? This site is for you! If you use an earlier version of Word, visit our WordTips site focusing on the menu interface.

Videos
Subscribe

FREE SERVICE: Get tips like this every week in WordTips, a free productivity newsletter. Enter your address and click "Subscribe."

(Your e-mail address is not shared with anyone, ever.)

View the most recent newsletter.