Mail merge for married contacts with different last names

B

bsharp

I am in Word 2007 and trying to create a letter from my Outlook contacts.
Nearly all my clients are either married, or have a partner, but I only
create one contact record in Outlook for them (having two contact records
isn't an option for me). Sometimes they have different last names, which
creates problems when writing letters.

I am using BCM, and I have created two user-defined fields. One for
spouse/partner first name, the other for spouse/partner last name.

I am using if then statements in the mail merge, and am coming very close to
making this work. I can get the salutation to work no problem, it only brings
in the 2nd name if there is one there, and adds an " and " between them.

Where I am having trouble is in creating the envelope. For example, if my
clients are Bob Smith and Sarah Jones, I want the envelope to read, "Bob
Smith and Karen Jones."

Here is what I have come up with below. It came very close once, but I've
got something in the wrong spot somewhere, and as I try to "fix" it I'm
making it worse. I know some of the quotes are out of place somewhere.

{if {mergefield "spousepartner_last_name"}="" {mergefield
"first_name"}{if{mergefield "spousepartner_first_name"}="" {mergefield
"last_name"} and "{mergefield "spousepartner_first_name"}{mergefield
"spousepartner_last_name"}"}}
 
D

Doug Robbins - Word MVP

Use

{if {mergefield "spousepartner_last_name"}<>"" "{mergefield
"first_name"} {mergefield "last_name"} and {mergefield
"spousepartner_first_name"} {mergefield
"spousepartner_last_name"}" "{if {mergefield "spousepartner_first_name"} <>
"" "{mergefield "first_name"} and {mergefield "spousepartner_first_name"}""
{mergefield "Last_Name}" "{mergefield "first_name"} {mergefield
"last_name"}"}}

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP
 
G

Graham Mayor

I trust Sarah Jonses will not mind being addressed as Karen Jones? ;)

{ Mergefield First_Name } { IF{ Mergefield Spousepartner_last_name } = ""
"{ IF { Mergefield spousepartner_first_name } <> "" "and { Mergefield
spousepartner_first_name } { Mergefield Last_Name }" "{ Mergefield
Last_Name }" }" "{ Mergefield Last_Name } and { Mergefield
spousepartner_first_name } { Mergefield Spousepartner_last_name }" }

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP


<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 
B

bsharp

Thanks!

Doug Robbins - Word MVP said:
Use

{if {mergefield "spousepartner_last_name"}<>"" "{mergefield
"first_name"} {mergefield "last_name"} and {mergefield
"spousepartner_first_name"} {mergefield
"spousepartner_last_name"}" "{if {mergefield "spousepartner_first_name"} <>
"" "{mergefield "first_name"} and {mergefield "spousepartner_first_name"}""
{mergefield "Last_Name}" "{mergefield "first_name"} {mergefield
"last_name"}"}}

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP
 
B

bsharp

Thanks!

Graham Mayor said:
I trust Sarah Jonses will not mind being addressed as Karen Jones? ;)

{ Mergefield First_Name } { IF{ Mergefield Spousepartner_last_name } = ""
"{ IF { Mergefield spousepartner_first_name } <> "" "and { Mergefield
spousepartner_first_name } { Mergefield Last_Name }" "{ Mergefield
Last_Name }" }" "{ Mergefield Last_Name } and { Mergefield
spousepartner_first_name } { Mergefield Spousepartner_last_name }" }

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP


<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 

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