merging different name formats

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= 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:
John Doe, John and Mary Doe, John Doe and Mary Smith.
 
G

Graham Mayor

1 & 2 are easy to arrange using condtional fields, but I see no way of
handling 3 also, unless you create a new Outlook field and separate the
spouse's surname and forename in the data file.

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

Peter Jamieson

Thought I'd answered this one...

As long as the Spouse names follow a certain pattern, e.g.
a. In your case (2) there is only ever one name in spouse, e.g. never "Anne
Marie"
b. In your case (3) there is always more than one name
c. the characters in the names are in alphabets that have
lowercase/uppercase versions of the letters

you can try the following:

{ 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 are also always capitalised the same way, i.e. all lowercase
except all initial caps, you can simplify that 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 }" }" }
 

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