Set the rules for a mail merge

When you're sending letters to your mailing list you can customize the message. For example, include the words "Past due" for some recipients based on values in certain fields of the data source. The customization is based on rules that run when you perform the merge.

The "Past due" example would use an If...Then...Else rule, specifying to include the text, "Past due" for recipients where the value of a Due Date field is in the past.

Setting up rules is done after selecting recipients for the mail merge, and after inserting merge fields in the document..

Go to Mailings > Rule, and choose a rule based on the descriptions below.

For example, you're sending out the same invitation for a quarterly meeting. Your data source doesn't store the meeting dates, and the meeting date appears more than once in the invitation.

By placing bookmarks in your document and including an Ask field, you can run the same merge for each meeting. The only thing you'll have to type is the meeting date, and you'll type it just once.

  1. In the merge document, press Ctrl+F9 and then type a name to create a bookmark. Repeat this, using the same name, in every place where you want the response to the Ask field to appear in the document.

  2. Place your cursor somewhere in the document, before the first bookmark you just created.

  3. Go to Mailings > Rules > Ask.

  4. Select the bookmark you just created (or type its name), and enter a prompt, like "Event date?" in the Prompt box.

  5. Select OK, and then OK again.

  6. At the end of the process, when you select Finish & Merge, choose Edit Individual Documents. You'll be prompted for a response for each recipient. That response will be inserted in the bookmarks you specified, in the documents that result from the merge.

More info: Field codes: Ask field

For example, you're sending the same invitation for a quarterly meeting. Your data source doesn't store the meeting dates, and the meeting date appears only once in the invitation.

By placing a Fill-in field in the document, you can run the same merge for each meeting. The only thing you'll have to type is the meeting date.

  1. Place your cursor where you want the fill-in text to go.

  2. In the Mailings tab, go to Rules > Fill-in.

  3. Enter a prompt, like "Event date?" in the Prompt box.

  4. Select OK, and then OK again.

  5. At the end of the process, when you hit Finish & Merge, select Edit Individual Documents. You'll be prompted for a response for each recipient. That response will be inserted in the Fill-in field, in the documents that result from the merge.

More info: Field codes: Fill-In field

For example, you're sending out correspondence to a list of conference attendees who are traveling both domestically and internationally. The Country/Region field in your data source might be blank for domestic attendees. You can use an If...Then...Else... rule to personalize the message for all the recipients. Recipients whose Country/Region field is blank might see, "You will be welcomed at the gate upon arrival," whereas all other recipients might see, "You will be welcomed at the desk near Customs."

  1. Place your cursor where you want the conditional text to go.

  2. Go to Mailings > Rules > If...Then...Else.

  3. In the Field name list choose the field from your data source that will determine the conditional text.

  4. In the Comparison list choose a way of comparing the data value.

  5. In the Compare to box, enter the comparison value (skip this if you chose is blank or is not blank as the comparison).

  6. In the Insert this text box, enter the text that goes in the document when the comparison criteria is met.

  7. In the Otherwise insert this text box, enter the text that goes in the document when the comparison criteria is not met.

  8. Select OK.

More info: Field codes: IF field

For example you want correspondence to show each recipient their position in a waitlist. You can sort the recipient list in chronological order of signups, and then use a Merge record # rule to display the recipient's numbered position in the list.

The record number reflects any sorting or filtering that you applied to the data source before the merge.

Tip: Use a Merge rec # rule next to a Print Date field to create unique invoice numbers.

  1. Place your cursor where you want the record number to appear.

  2. Go to Mailings > Rules > Merge Record #.

More info: Field codes: MergeRec field

For example, you want correspondence to show each recipient the total number of people who signed up for an event. The Merge Sequence # rule gives you a count of the records in the merged document.

  1. Place your cursor where you want the record number to appear.

  2. Go to Mailings > Rules > Merge Sequence #.

More info: Field codes: MergeSeq field

For example, you're using mail merge to print your contact list on a single sheet of paper. Use the Next Record rule to tell Word to proceed to the next record without starting a new page.

Note: A sheet of mailing labels is laid out as a table in Word. To place the next address in the label, Word uses the Next Record rule in each table cell.

  1. Place your cursor where you want data from the next record to appear.

  2. Go to Mailings > Rules > Next Record.

  3. Insert a merge field for the data you want next

    A list of company names might look like this:

    «Company_Name»
    «Next Record»«Company_Name»
    «Next Record»«Company_Name»

More info: Field codes: Next field

For example, you want a list of domestic-travel conference attendees on one sheet of paper and international-travel attendees listed on another sheet of paper. The Country/Region field in your data source might be blank for the domestic travelers. You can use a Next Record If rule to prevent Word from starting a new page until it reaches recipients whose Country/Region field is not blank. To achieve this, you would first sort your data source by Country/Region.

  1. Place your cursor where you want data from the next record to appear.

  2. Go to Mailings > Rules > Next Record If.

  3. In the Field name list choose the merge field name, such as City.

  4. In the Comparison list choose a way of comparing the data value. For example, to single out recipients in a particular city, choose Equal to.

  5. In the Compare to box, enter the value that you want to use. For example, to single out recipients in Tokyo, type Tokyo (skip this if you chose is blank or is not blank as the comparison).

More info: Field codes: NextIf field

For example, you're preparing invitations to a conference where the keynote speaker hasn't yet been finalized. You can leave placeholders for the speaker's name throughout your document, and include a Set Bookmark rule, where you enter the speaker's name once, and it appears in all the placeholders.

Placeholders are Ref fields; the Set Bookmark rule inserts a field that isn't displayed in the document (unless you press Alt+F9 to reveal field codes).

  1. Place your cursor anywhere in the document.

  2. Go to Mailings > Rules > Set Bookmark, and type a name, and then select OK.

  3. Place your cursor wherever you will want the bookmark text to appear.

  4. Go to Insert > Quick Parts > Field, and choose Ref.

  5. Choose the bookmark name you just created, and select OK.

  6. Insert the Ref field everywhere you want the bookmark text to appear.

  7. Before you run the merge, right-click the Set field, select Edit Field, and enter the text you want in the Text box.

  8. Select OK.

More info: Field codes: Set field 

For example, you own a clothing store and find you have an overstock of a particular T-shirt, but not in the most popular size. When you get ready to send out a sales flyer, you're going to exclude customers who wear a certain size. Use the Skip Record If rule to compare contents of customers' Size data to the size you want to exclude.

  1. Go to Mailings > Rules > Skip Record If.

  2. In the Field name list choose the merge field name, such as Size.

  3. In the Comparison list choose a way of comparing the data value. For example, to single out customers who wear a specific size, choose Equal to.

  4. In the Compare to box, enter the value that you want to use. For example, to single out customers who wear size extra-small, choose XS (skip this if you chose is blank or is not blank as the comparison).

More info: Field codes: SkipIf field

Need more help?

Expand your Office skills
Explore training
Get new features first
Join Office Insiders

Was this information helpful?

Thank you for your feedback!

Thank you for your feedback! It sounds like it might be helpful to connect you to one of our Office support agents.

×