Dreamboat on Word: Word 2000, Word 2002, Word 2003 (On Office series)

 < Day Day Up > 


Conditional Mail Merges

Don’t confuse a conditional mail merge with a mail merge query. Though they can be similar, they are not the same.

Suppose you have a retail store with a men’s department and a women’s department. Your data source has a column for Gender and contains M for Male and F for Female.

If they’re male, you want to have a sentence in your letter that reads:

Visit our Men’s Department today!

And, of course, if they’re female, you want that sentence to read:

Visit our Women’s Department today!

Choose from the Mail Merge toolbar: Insert Word Field If…Then…Else… to get the dialog displayed in Figure 17-3.

Figure 17-3: Insert Word field: IF Dialog Box

When you hit OK and turn your field codes to be viewable, it’ll look like Figure 17-4.

Figure 17-4: Mail Merge Conditional IF Statement

Tip 38: Show/Hide Field Codes

Make your field codes viewable by hitting the shortcut keys Alt+F9. Do the same to turn them off again. A lot of people see field codes accidentally, so you’ll want to remember how to turn off viewing them.

Very detailed conditional statements can be written and there are people out there who can write them without help from the dialogs. I am not one of them. However, here are some tips that may help:

Tip 39: Correct Number and Date Formatting of Merge Fields

Make your field codes viewable by hitting the shortcut keys Alt+F9. Do the same to turn them off again. A lot of people see field codes accidentally, so you’ll want to remember how to turn off viewing them.

It seems recent versions of Word have this problem more than older versions. You merge to a date field in Excel, and it’s formatted improperly after you merge it.

If your merge fields aren’t formatted right, you can force them. Two examples are shown in Figure 17-5.

Figure 17-5: Mail Merge Field Format Statement


 < Day Day Up > 

Категории