Using Query Options in a Word Mail Merge


As your database grows it is increasingly likely that you will want to send mailings to selected people rather than to everyone on the list. Word provides a tool to help you specify which members of your mailing list are included in a mail merge… Query Options.

About Query Options

Query Options makes use of information contained in the database itself, combined with rules that you set up, to select particular records to include in the mail merge. This means that, in order to make use of Query Options, your criteria for including or excluding people from your mailing must depend upon something that is referred to in the data.

For example, you may wish to mail only to people in a certain town (using the Town field to get the information), or perhaps companies whose names fall in a certain part of the alphabet (using the Company field to get the information).

Preparing the Merge Document

Start by creating your mail merge document in the normal way. When you are ready to run the merge choose Query Options to open the Query Options dialog box.

Opening the Query Options dialog boxYou will find a button for Query Options in the mail merge helper window, and another in the merge window. They both do the same thing.

The Query Options dialog box is in two parts. One lets you specify how you want your records filtered, the other lets you specify how (if at all) you want your records sorted. You can use either or both.

Defining a Filter

We'll start with the Filter Records tab. This presents you with a grid into which the filter criteria can be entered. 

The first step is to choose a field from the drop-down list.Each row of the grid represents a single criterion or condition.

The grid section is divided into three columns, Field:Comparison: and Compare to:.

Field: provides a drop-down list of all the fields in your database. You don't need to have used all these fields in the body of your letter - certain fields might exist solely for the purpose of selecting records. Choose the appropriate field from the list. In this example I am choosing to mail to clients in a particular town. That information is to be found in the Town field.

Comparison: provides another drop-down list with a number of expressions (known as "operators") which instruct word how to make its decision about each particular record. I want Word to match records to a particular town so I have chosen Equal to.

Compare to: is a text box in which you type what is essentially the answer to the question "Compare to what?" I have typed the name of my chosen town.

This filter will select all the companies on the list that are located in London

The Filter Records section is also divided into several rows. This allows you to add further criteria to your filter and create a multiple selection rule. Supposing I wanted to further confine my mailing to clients whose names begin with letters from the first half of the alphabet.

This filter will select all the companies on the list that are located in London and whose names start with the letters A to M.

Note that And has been chosen to link the two criteria (as opposed to Or). This means that Word will only include those records that can specify both criteria. In other words, to be included in the mailing the company must have a London address and its company name must fall within the range A - M.

When creating multiple selection criteria it is important to make the correct decision about whether to choose And or Or to link them. If I wanted to mail to clients in either of two towns I must choose "Or". If I chose "And" Word would look for addresses that contained both towns - and wouldn't find any!

This filter will select all the companies on the list that are located in London as well as those companies located in Manchester.

Things get a bit more complicated when you need to specify multiple criteria relating to different fields. The best way to check if you've got it right is to read it out loud and see if it makes sense!

Look at the example above. Suppose I wanted to further refine this filter to choose only those companies with names in the range A - M. You might think it sufficient to add a third row specifying "And… Company… Less than… N". Wrong!

What you would get would be "Town equal to London" or "Town equal to Manchester and Company less than N". The And on the third line would only link it to the line above.

The correct way to define the filter is shown below. It means "Town equal to London and Company less than N" or "Town equal to Manchester and Company less than N".

This filter will select all the companies on the list that are located in London whose names fall between A - M as well as those companies located in Manchester whose names fall between A - M.

Your filter can contain up to six rows of instructions.

If you find it difficult to construct a suitable filter, you may find it useful to add one or more fields to your database that can be used to classify the various members of your mailing list. These fields would not necessarily be utilised in the merge document itself, but would be a great help when designing the filter.

Defining a Sort

Although you don't have to make use of the Sort Records option, it can be a very useful tool. Mailing lists tend to grow and change, and end up arranged in no particular order. The Sort Records option allows you to request that documents be printed in a particular order regardless of the arrangement of the original data.

If you don't ask for a particular sort order, the documents will be printed in the order that the records occur in the database.

In this example, all the companies in London will be printed first, in alphabetical order, followed by all the companies in Manchester, also arranged in alphabetical order.You can choose to sort by up to three different fields, and each can be sorted in ascending (A - Z) or descending (Z - A) order. Simply choose the appropriate field(s) from the drop-down list.

Remember, if you want to print your whole mailing list in a particular order, you can use Sort Records without using Filter Records. When you have finished specifying the query options, click <OK> to return to the mail merge helper or the merge window. You are now ready to run the merge.

TIP: If you use mail merge to create letters, then again to print labels or envelopes for the same mailing, remember to use the same sort order for both! You don't want to waste time trying to match letters with envelopes!

Choosing How Many Records to Merge

The Merge window contains a further option to let you specify how many records are merged.

If you have a large mailing list and would rather perform the merge in stages, you can ask for a particular batch of records to be merged now and merge the rest at another time.

For example, if you have 200 names on your mailing list, you could ask for records 1 - 50 today, 51 - 100 tomorrow, 101 - 150 the next day and so on. This also avoids tying up the printer with one very long job.

This instruction will print only the first 50 records.

Read 84 times Last modified on Thursday, 28 February 2019 21:14
Dylan Austin


Whenever I have a problem, I sing. Then I realize my voice is worse than my problem.

We use cookies to improve our website. By continuing to use this website, you are giving consent to cookies being used. More details…