Mail Merge Greetings for individuals and Couples

F

Fiona

Hi folks

Am new to mail merge, and have had a task asked of me, so thanks in advance
for your help!

We need to create a template that correctly greets both individuals and
couples. ie "Dear Bob", or "Dear Bob and Sue", depending on the data
available. Can you help me with the correct way to do this?

The data source (relational database) is such that there may or may not be a
spouse associated with the primary person, so I need the template to have
some kind of condition that if the letter is for a couple, it adds "and"
before the second name, and if it is just to an individual then it doesnt.

Hope this makes sense, and is possible. Not sure if some kind of macro is
required?

Thanks!
 
P

Peter Jamieson

What to do depends on exactly how your data is set up (and in theory
there's a shortcut in Word 2002 and later for some situations)

e.g. if
a. the two fields you need are /always/ in the same record
b. you have fields like
primaryforename
secondaryforename
c. primaryforename is never blank and you always want at least

Dear primaryforename

d. if secondaryforename not blank, you add

and secondaryforename

then you can use

Dear { MERGEFIELD primaryforename }{ IF "{ MERGEFIELD secondaryforename
}" <> "" " and { MERGEFIELD secondaryforename }" "" }

The nested IF field is a field placed in the appropriate place in your
document's text like any other - it's not a "macro" in the sense usually
understood in Word. But each pair of special field code braces {} must
be the sort you can insert using ctrl-F9, not the ordinary ones you can
type on the keyboard. Also, I'm assuming that when the secondaryforename
field is blank (or perhaps null), what gets through to Word is an empty
string "", not e.g. " " or something else.

If you are only using Word 2002 or later, in the above situation you
should also be able to use

Dear { { MERGEFIELD primaryforename }{ MERGEFIELD secondaryforename \b "
and " }

However, I have to say that this seems to hang Word rather more
frequently that I would want to put up with.


Peter Jamieson

http://tips.pjmsn.me.uk
 

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