Following are instructions to create a conditional mail merge in Microsoft Word. You need a form letter and a data file. Create the form letter in Microsoft Word and use The Raiser's Edge to export the data file.

Note: For Microsoft Word 2002, refer to How to create a conditional mail merge letter in Microsoft Word 2002 or Office XP. To perform a simple mail merge, refer to How to create a simple mail merge letter.


A mail merge is a word processor function that produces multiple letters or labels by combining a form letter and a data file. The form letter is the shell used for design. The data file contains all the personalized information that makes each letter unique; for example, primary address, primary salutation, and address. A conditional mail merge combines a set of simple merge documents with one data file; one or more conditional statements route each record in your data file to the appropriate merge letter.
 


Creating the Form Letter in Word

  1. Select File, New from the menu bar. Select Blank and click OK.
  2. Select Tools, Mail Merge from the menu bar. The Mail Merge Helper screen appears.
  3. Click Create and select Form Letters. Click Active Window.
  4. To attach your data file, click Get Data, and then select Open Data Source. Select the appropriate file. The data file usually has a .dat extension. A screen appears stating Word found no merge fields in Main Document. Note: Microsoft Word defaults to look for a file with a .doc extension. ("All Word Documents *.doc, *.dot, *.htm"). In the Files of type field, select All Files (*.*) and then browse to the location of the *.dat file, which is on your Blackbaud Control Report.
  5. Click Edit Main Document. You may be prompted for a Field Delimiter. Word defaults to Tab, but change this to Comma (,), and then click OK.
  6. A blank document including the Mail Merge toolbar appears. This empty document is the actual document
    in which you will create the body of your letter.
 

Inserting the Conditional Statements
The conditional merge document contains only conditional statements. When you begin to add the statements, make sure the cursor is at the top of the page.

Note: Before you begin, select Tools, Options from the menu bar, and, in the Show frame, mark the Field codes checkbox.

  1. Click Insert Word Field and select If...then...else. A screen appears allowing you to select the field you want to evaluate.
  2. Select the field name from the Field name list that corresponds to the data field on your Control Report that will be used to create the conditional statements. Typically, you will use the Letter field; however, you can use any field in the data file.
  3. The comparison defaults to Equal to. Enter the value you want your data field to equal in the Compare to field. This is the value from the data field table in The Raiser's Edge. Enter the description exactly as it appears in the data file.
  4. Click OK. Part of the conditional statement  appears in your document. It should be similar to the sample below:

    {IF {MERGEFIELD Letter} = "AnnualThankYou" "" ""}

     

    The first set of quotes represents "if," the second set represents "then," and the third set represents the "else."

  5. Place your cursor between the first empty set of quotes, which corresponds to the "then" section.
  6. Select Insert, Field from the menu bar. The Field screen appears.
  7. In the Categories column, highlight Links and References and under Field Names, highlight Include Text.
  8. Under Field codes, place your cursor after "INCLUDETEXT" and enter the document name of the letter that should print if
    the conditional value in the data file satisfies the criteria you've specified. Make sure there there is a space between the values.
    Note: If you do not see field codes, select Tools, Options from the menu bar and, in the Show frame, mark the Field codes checkbox.
  9. Click OK. The conditional statement should now look similar to the following:

    {IF {MERGEFIELD Letter }= "AnnualThankYou" "{INCLUDETEXT Annual.doc \ * MERGEFORMAT}" ""}

  10. Repeat step 3 to establish one conditional statement for each conditional field value in your data field. The following example tells Microsoft Word to include the file named Annual.doc if the letter value in the data file is equal to AnnualThankYou. If the value is CapitalThankYou, the Capital.doc is processed instead.
     

    {IF {MERGEFIELD Letter} = "GeneralThankYou" "{INCLUDETEXT Annual.doc\*MERGEFORMAT}" ""}{IF {MERGEFIELD Letter} = "CapitalThankYou" "{INCLUDETEXT Capital.doc\*MERGEFORMAT}" ""}

    Note: Do not add a carriage return (by pressing Enter) between conditional statements.



Merging the Letters
  1. Select Tools, Mail Merge from the menu bar. The Mail Merge Helper screen appears.
  2. Click Merge. The Merge screen appears.
  3. In the Merge to field, select the merged letters' destination: your printer or a new document. If you merge to a new document, you can view the letters on the screen before printing. Select the appropriate option.
  4. In the When merging records frame, mark the option Don't print blank lines when data fields are empty.
  5. Click Merge to begin the actual merge.
 

Example
Suppose you want to send a letter thanking individuals for their donation. You have several different letters you send depending on the gift type and gift amount: Pledges, General Thank You, and Gifts more than $1,000. Using the instructions above you would set each of these letters, code the gift with the appropriate letter type, and have a conditional statement indicating what letter to use.

In plain English, the logic of the conditional statements would read:

If the gift is coded with a pledge thank you letter then print the Pledge Thank You letter;
else if the gift is coded with a general thank you letter then print the General Thank You letter; else if the gift is coded with a gift over $1000 letter then print the Gifts over $1000 thank you letter.


Tips for a Successful Merge

  • Create a directory on your local drive, and save all of the documents in this directory. For example, for donor acknowledgment letters, call the directory Acknow. This will eliminate errors when you create the conditional statements and also allow you to easily copy all letters to other workstations.
  • Save the data file for the conditional merge in the directory you created. For example, save Acknow.dat in the Acknow directory.
  • Do not use spaces in your field names. Such as General Thank You instead keep it as one word: generalthankyou.

Need help? Take the online course Creating Letters using Mail Merge.

In The Raiser's Edge 7, consider creating merge letters using Word integration and the Mail Merge Wizard: For more information, review The Raiser's Edge & Microsoft Office Integration Guide (PDF).