solving various name formats in mail merger in Word 2003

M

Mike S

In our Outlook 2003 data we have three different name formats, the data is in the following fields
1. John Doe: first= John, last= Do
2. John and Mary Doe: first= John, Spouse= Mary, Last= Do
3. John Doe and Mary Smith: first= John, last= Doe, spouse= Mary Smit

We are trying to figure out how to construct a merge field so letters and envelopes will print all these names correctly ie
John Doe, John and Mary Doe, John Doe and Mary Smith
 
P

Peter Jamieson

As long as your spouse names always conform to certain rules, i.e.
a. one name means you have your type (2) situation (i.e. no forenames such
as Anne Marie, only Ann-Marie)
b. more than one name separated by spaces means you have your type (3)
c. the names are in an alphabet where there's an uppercase and lowercase
version of each letter

then you could try
{ MERGEFIELD first } { IF "{ MERGEFIELD spouse }" = ""
"{ MERGEFIELD last }"
"{ IF { QUOTE { MERGEFIELD spouse \*lower } \*firstcap }
= { QUOTE { MERGEFIELD spouse \*lower } \*caps }
"and { MERGEFIELD spouse } { MERGEFIELD last }"
"{ MERGEFIELD last } and { MERGEFIELD spouse }" }" }

If the names in the spouse field in the data source always have the first
letter of each name in upper case and the rest in lower case, you could
simplify that a bit to

{ MERGEFIELD first } { IF "{ MERGEFIELD spouse }" = ""
"{ MERGEFIELD last }"
"{ IF { QUOTE { MERGEFIELD spouse \*lower } \*firstcap } = { MERGEFIELD
spouse }
"and { MERGEFIELD spouse } { MERGEFIELD last }"
"{ MERGEFIELD last } and { MERGEFIELD spouse }" }" }

If things are not that consistent, you may need to consider creating the
data source you need (not easy in this case) or using Word VBA (probably
with Word's Mailmerge Events) to process the data in some way.

--
Peter Jamieson - Word MVP

Mike S said:
In our Outlook 2003 data we have three different name formats, the data is in the following fields.
1. John Doe: first= John, last= Doe
2. John and Mary Doe: first= John, Spouse= Mary, Last= Doe
3. John Doe and Mary Smith: first= John, last= Doe, spouse= Mary Smith

We are trying to figure out how to construct a merge field so letters and
envelopes will print all these names correctly ie:
 

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