Find out how >
IT Training solutions
designed around you
All our training is tailored to you and what you need to do your work; efficiently, effectively and with less frustration.

Mail Merge – who uses that anymore?

8th February 2019
Mail Merge is one of the oldest features in word processing. But nowadays surely there are more up-to-date and powerful methods of doing mailings? But perhaps it is the concept of "standard" letters that is the reason for its under-utilisation in Word. In fact, you can produce numerous variations of content by including tests on the source data. This article introduces the concept, assuming you already know how to do basic mail merge (knowledge level intermediate to advanced).

In Excel you may be familiar with the IF function to perform logical tests.  In Word the equivalent is an IF field.  There are lots of different fields in Word; you may be familiar with the {PAGE} field which gives you automatic page numbering or the {DATE} field which displays today's date.  As you see fields are enclosed in braces (curly brackets) but these are not created by typing the symbol on the keyboard.  When you insert merge fields in your main document you may see <<Surname>> but behind this is a field code {MERGEFIELD Surname}.

Usually, when you click in a field in a document it is shaded.  If you right-click on a field, the shortcut menu has three Field commands – Update field, Edit field and Toggle field codes.   Here are some function key shortcuts that are useful for fields:

F9: Update field - updates all fields contained in the current selection.
Shift+F9: Toggle field display - toggles field code display for fields contained in the current selection (ie toggles between field results and field codes).
Alt+F9: View field codes - toggles field code display for all fields in the entire document even if a field is not currently selected (includes headers and footers).

Most fields are entered in a document by choices you make from the menu and in dialog boxes.  A full list of fields is found on the Insert tab, Quick Parts drop-down and Field… However, this article is about the IF field.  There are two approaches to entering this for Mail Merge – the simple menu and dialog method which produces simple results and the more complex manual method which enables more powerful results.  The latter will be the topic of a future article.

Our scenario is a document that is being sent to confirm a booking and give joining instructions – a training course, a conference – it doesn't matter.  We have two locations – Basingstoke and Birmingham – and we have different travel instructions for each.  Using the IF field we can test the Location merge field in the source data and have a different sentence inserted in the merged document accordingly.

On the Mailings tab, you click the Rules drop down menu and choose If…Then…Else.  The top part of the dialog box makes it easy to create the test.  You select the merge field name you are testing, the comparison (equal to, greater than, etc.) and then enter the text or number you want to compare.  In the following image, our test is Location merge field name Equal to Basingstoke.

If dialog box.jpg

In the Insert this text box, you type the text you want inserted if this is true.  In the Otherwise insert this text box you type the text you want inserted if this is false.  Then you click OK.

Initially, you will see the true or false result for the current record number but if you Preview results and move through the records, the sentence should change for each record depending on the Location for that record.

If you view the field code behind the result, it will look thus: 

IF field code.jpg

If you are used to Excel functions with commas separating arguments and helpfully colour coded pairs of brackets, Word functions are potentially confusing!  There are similarities in that literal text is enclosed in quotation marks.  However, Word uses a space to separate the true and false arguments, so the syntax is as follows:

{IF test true false}

In a future blog we will look at more complex IF field syntax.  In the meantime, if you would like to discuss how SJM Training could help your company get the most from Word then please get in touch.

Sally Williams