need help suppressing 2nd name in mail merge

J

Joi Rhone

I am doing an excel mail merge to create letters. Some of the letters
have 2 names as the addresee and some have only one person the letter
is being addressed to. How do I supress the salutation is there is no
2nd name? For example, if there is no name2 in the field, then it will
suppress the spaces and only show one name. Please help!
 
P

Peter Jamieson

You can either create the column you need in Excel, using Excel formulas, or
use nested IF fields in Word.

With real-world data there can be many different combinations of 2 names
that you might want to use in a greeting. For example,
For example, suppose each of your records potentially has two names, one
consisting of forename1 and surname1 and the other of forename2 and
surname2. Suppose forename1 and surname1 are never blank, but forename2 and
surname2 are either both present or both blank. And suppose you want


Dear forename1 surname1 (where forename2 and surname2 are blank)
and
Dear forename1 and forename2 surname1 (where the names are not blank but
surname1 = surname2)
and
Dear forename1 surname1 and forename2 surname2 (where the names are not
blank and surname1 <> surname2)


In that case, you can combine "IF" fields with MERGEFIELD fields to get what
you want, e.g.


Dear { MERGEFIELD forename 1


} { IF "{ MERGEFIELD surname2 }" = ""


"{ MERGEFIELD surname1 }"
"{ IF { MERGEFIELD surname2 } = { MERGEFIELD surname1 }
"and { MERGEFIELD forename2 } { MERGEFIELD surname1 }"
"{ MERGEFIELD surname1 } and { MERGEFIELD forename 2 } { MERGEFIELD
surname2 }" }" }

However, before you dive into something like that it's probably a good idea
to consider what greeting lines you actually want for each combination of
values in your data (and if you are maintaining your own data, what data you
need to support the greeting lines that you really want to use).

All the {} are special field braces you can insert on Mac Word using
Command-F9 (and if you're really using Windows Word, it's ctrl-F9)

Peter Jamieson
 
M

macropod

Hi Joi,

At its simplest, you'd code your mergefields like:
Dear {MERGEFIELD 1stName}{IF{MERGEFIELD 2ndName}<> "" " and {MERGEFIELD 2ndName}"}
where the field braces (i.e. '{ }') are created in pairs via Command-F9.

Cheers

--
macropod
[MVP - Microsoft Word]


| I am doing an excel mail merge to create letters. Some of the letters
| have 2 names as the addresee and some have only one person the letter
| is being addressed to. How do I supress the salutation is there is no
| 2nd name? For example, if there is no name2 in the field, then it will
| suppress the spaces and only show one name. Please help!
|
 

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