For Microsoft Word 2000 and prior, refer to How to create a conditional mail merge letter in Microsoft Word 2000 and prior (BB54).

What is a mail merge?

A mail merge is the function in a word processor 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 of the variable information (usually name, address, and salutation for a letter). A conditional mail merge consists of a series of merge documents and one data file; one or more conditional statements ensure your word processor automatically selects the appropriate merge letter for each row of data in your file.

Creating the Form Letter

  1. Create the data file by running a mailing function or export from your Blackbaud software program.
  2. Create the form letters in Microsoft Word 2002.

Creating the Conditional Document

  1. In Microsoft Word 2002, select File, New from the menu bar.
  2. In the New Document section under New, click Blank Document.
  3. Click View, Toolbars and select Mail Merge.
  4. The following toolbar buttons display:
  5. Click the Open Data Source toolbar button.
  6. In the Select Data Source window in the Files of Type field, select All Files.
  7. In the Look In field, browse to the data file and click Open.
  8. Select Tools, Options from the menu bar and mark the Field Codes option.
  9. Click OK.
  10. If needed, put the cursor at the top of the blank document.
  11. Click Insert Word Field on the toolbar and select If...then...else.
  12. The following screen appears:

  13. Select the field name from the Field Name list that corresponds to the data field select the field you want to evaluate. This is normally the letter field, but it may be any data field.
  14. Keep the Comparison set to the default of Equal To.
  15. 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 your Blackbaud program. Enter the description exactly as it appears.
  16. Click OK.
  17. Part of the conditional statement appears in your document. It should be similar to the sample below:
    {IF {MERGEFIELD Ltr} = "GeneralThankYou" "" ""}
    Note: The first set of quotes represents "if" (in the example, it contains GeneralThankYou), the second set represents "then", and the third set represents "else"
  18. Click between the first empty set of quotes in the conditional statement to position your cursor in the "then" section.
  19. Select Insert, Field from the menu bar.
  20. In the Categories column, select Links and References and highlight Include Text.

  21. Click the Field Codes button in the lower left corner.
  22. Place the cursor after the words, Include Text, in the Field Codes text box.
  23. Enter the document name containing the paragraphs that should print if the letter value meets the criteria you defined, for example general.doc. Note: Be sure to include a space between the values Include Text and general.doc.

  24. Click OK.
  25. The conditional statement now looks like this:
    {IF {MERGEFIELD Ltr }= "GeneralThankYou" "{INCLUDETEXT general.doc \* MERGEFORMAT}" ""}
  26. Repeat steps 8-22 to establish one conditional statement for each value in your data field (for example, one conditional statement for each letter)
  27. The following example tells Microsoft Word 2002 to include the file named general.doc if the letter value in the data file is equal to GeneralThankYou. If the value is PledgeThankYou, pledge.doc is included.
    {IF {MERGEFIELD Ltr}= "GeneralThankYou" "{INCLUDETEXT general.doc\*MERGEFORMAT}" ""}{IF {MERGEFIELD Ltr} = "PledgeThankYou" "{INCLUDETEXT pledge.doc\*MERGEFORMAT}" ""}
    Note: Do not to press Enter between each include statement. It puts a hard return in the document which will cause errors.
  28. Click Save.
  29. Name the file conditional.doc and place it in the same folder as the form letters.

Merging the Letters

  1. Click the Merge to New Document button on the Mail Merge toolbar (fourth from the right). Note: You can also merge directly to your printer, email, or fax by clicking those options on the Mail Merge toolbar.

    Note: A new Word 2002 feature allows you to check your merge document for errors (this process is similar to the validate import file option). Click the Check for Errors button on the Mail Merge toolbar (fifth from the right). You have several options:

  2. After your merged letters print to screen, review them and print them from Word.

Tips for a Successful Merge

  • Create a folder on your local hard drive and save all of the documents in this folder: the form letters, conditional document, and data file.
  • Do not use spaces in your field names: instead of General Thank You use generalthankyou.

For more information, please refer to the Word 2002 Mail Merge Resource Center Check to see if Blackbaud software is compatible with Microsoft Office XP. The Raiser's Edge 7.5 and higher allows for direct integration with Microsoft Word for creating conditional mail merge letters. To learn more about this integration process please refer to The Raiser's Edge and Microsoft Office Integration Guide (PDF). To find out specifics about creating a conditional mail merge using the integration process refer to How to create a conditional mail merge using the mail merge wizard (BB97809).