Mail Merge: Multiple Merge Fields for both Yes/No within an IF statement

P

P Straube

I download a large Christmas card list from my contact manager software. Sometimes the address is under either home or business set of fields (e.g., HomeStreet vs. BusinessStreet and HomeCity vs. BusinessCity, etc.). Being lazy, I don't want to take the time to manually modify the data file to put the addresses in one set of fields - so I need to set up a way to do it via "IF" MERGEFIELDS.
What I need to figure out is how to use an IF statement with multiple merge fields printed for both the YES and NO parts of the expression. I thought the following would have worked but I was wrong.

{ MERGEFIELD Title } { MERGEFIELD FirstName} { MERGEFIELD LastName }
{ MERGEFIELD Company }
{ IF { MERGEFIELD BusinessStreet } <> "" { {MERGEFIELD BusinessStreet }
{ MERGEFIELD BusinessCity }, { MERGEFIELD
BusinessState } { MERGEFIELD BusinessPostalCode } }
{ { MERGEFIELD HomeStreet }
{ MERGEFIELD HomeCity }, { MERGEFIELD HomeState }
{ MERGEFIELD HomePostalCode } }}

As you can see, I put the first set of Business merge codes inside one set of {} and the home merge codes inside another. I've searched the Knowledgebase but was unsuccessful with finding what is probably a simple solution.
Any help will be appreciated.
 
G

Graham Mayor

Try this:

{ MERGEFIELD Title } { MERGEFIELD FirstName} { MERGEFIELD LastName }
{ MERGEFIELD Company }
{ IF { MERGEFIELD BusinessStreet } <> "" "{MERGEFIELD BusinessStreet }
{ MERGEFIELD BusinessCity }, { MERGEFIELD
BusinessState } { MERGEFIELD BusinessPostalCode }" "{ MERGEFIELD
HomeStreet }
{ MERGEFIELD HomeCity }, { MERGEFIELD HomeState }
{ MERGEFIELD HomePostalCode }"}


--
<>>< ><<> ><<> <>>< ><<> <>>< <>>< ><<>
Graham Mayor - Word MVP
E-mail (e-mail address removed)
Web site www.gmayor.com
Word MVP web site www.mvps.org/word
<>>< ><<> ><<> <>>< ><<> <>>< <>>< ><<>
 
P

P Straube

Graham,
Thanks for your time with helping me.
Your suggestion worked perfectly (of course).
Another question, please. If I have a letter template or envelope template from Word 2003 that I want to be able to use after selecting contacts from Outlook 2003 - perhaps based on Category or simply their name - do you have any suggestions on where I can read up on how to do that?
Thanks again!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top