Conditional Mail Merges

 < 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.

click to expand
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.

click to expand
Figure 17-4: Mail Merge Conditional IF Statement

start sidebar
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.

end sidebar

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:

  • Begin by making sure that you’re viewing codes (Alt+F9).

  • Create a field by using Ctrl+F9 and begin typing your IF statement.

  • Hit Ctrl+F9 again each time you need to insert additional bracket sets.

start sidebar
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

end sidebar



 < Day Day Up > 



Dreamboat on Word
Dreamboat on Word: Word 2000, Word 2002, Word 2003 (On Office series)
ISBN: 0972425845
EAN: 2147483647
Year: 2003
Pages: 130
Authors: Anne Troy

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net