Related topics
×
Advanced mail merge
Sign in with Microsoft
Sign in or create an account.
Hello,
Select a different account.
You have multiple accounts
Choose the account you want to sign in with.
Advanced mail merge

Target recipients with field code

Your browser does not support video. Install Microsoft Silverlight, Adobe Flash Player, or Internet Explorer 9.

To make advanced mail merge even more effective, we can target the message using field code.

Want more?

Field codes in Word

Mail merge

Take mail merge to the next level

To make our email even more effective, we can target the message to only those recipients who need to have their cars serviced.

Then, we can eliminate any unclear language and be very direct – "It’s time to get your car serviced."

Click Edit Recipient List. I have added a column that shows when each recipient’s next service is due.

Click Filter. Choose the 'Next Service' field. In Comparison, select Less than or equal.

And in Compare to, type today’s date. And click OK.

The recipient list is now narrowed down to Next Service dates that are older than today.

The filter is a good solution, if you plan to email a document a few times.

But if you use Mail Merge a lot on a document, you can save time by filtering the recipients using Field Code.

First, click Filter and Clear All. Then, OK and OK.

Click at the beginning of your email. Then, click Rules.

This is where you can go, if you want to add a field code related to Mail Merge.

The field code we are going to use is Skip Record If.

With this one, you set up a condition, like 'First Name' is 'Equal to' 'Fred'.

If the condition is true, Word skips the record when it performs the merge.

Click Cancel, because we are going to enter our code manually.

Press Alt+F9, then Ctrl+F9 and type SKIPIF and space. Go to Insert Merge Field and select Next_Service and space.

Type the greater than and equal symbols, and space.

Then, press Ctrl+F9 and type DATE – the field code that displays the current date in a document.

Now Word will skip any record with a Next Service date that is greater than or equal to the current date.

Before the comparison will work, we need to add a picture switch that formats both dates exactly the same.

Click after Next_Service inside the field code.

Then, type space, backslash and the @ symbol to format the number as a date.

Then, inside quotation marks, type four uppercase Ys, two uppercase Ms, and two uppercase Ds.

Then, repeat this in the DATE field code.

Make sure the picture switch is the same for both field codes. Press Alt+F9 and F9 to update the field.

The SKIPIF field code is hidden and won’t be read by Word until you perform a merge.

Let’s test the SKIPIF code. Add a temporary merge field here that displays the Next Service date.

Click Finish & Merge, and let’s merge into individual documents. Click OK to merge all records to a new document.

Now as you scroll through the new document, check the dates, and we should only see emails with Next Service dates older than the current date.

When you are done, you can delete this test document.

Here’s one more thing you may find useful. Let’s say you make a mistake as you type some field code.

Before you finish a merge, click Check For Errors. Click Simulate the merge and report errors in a new document, and OK.

Word shows invalid merge fields.

In this case, you can Remove Field, or select the correct name from the list of Fields in data source.

If no more errors are found, click OK.

To perform the final merge, click Finish & Merge and Send Email Messages. Type a Subject line and click OK.

In this course, you learned how to go beyond the basic Mail Merge tools to perform Advanced Mail Merge using Field Codes.

To learn more about Field Codes, check out the links in the course summary.

Need more help?

Want more options?

Explore subscription benefits, browse training courses, learn how to secure your device, and more.

Communities help you ask and answer questions, give feedback, and hear from experts with rich knowledge.

Was this information helpful?

What affected your experience?
By pressing submit, your feedback will be used to improve Microsoft products and services. Your IT admin will be able to collect this data. Privacy Statement.

Thank you for your feedback!

×