IF Condition Question

T

Trudy

We are having a problem with an Outlook address/Word Mail Merge problem. In
the addresses that the recipient has a middle initial, the merge works fine.
When there is no middle initial, two spaces are being inserted between the
first and last names instead of one.

Could someone tell me what is wrong with the below? The middle initial is a
separate field.

The first condition is:
{ IF { MERGEFIELD Middle_Initial } = " " { MERGEFIELD First_Name }" " {
MERGEFIELD Last_Name }"

The second condition is:
" { MERGEFIELD First_Name }" " { MERGEFIELD Middle_Initial" "{ MERGEFIELD
Last_Name }"
 
D

Doug Robbins - Word MVP

Use

{ MERGEFIELD First_Name } { IF { MERGEFIELD Middle_Initial } = "" "{
MERGEFIELD Last_Name }" "{ MERGEFIELD Middle_Initial } {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

There is no 'middle_initial' field normally associated with merges from
Outlook - see http://www.gmayor.com/mailmerge_from_outlook.htm

However the correct syntax would be

{Mergefield First_Name}{IF {Mergefield Middle_Initial} <> ""
"<space>{Mergefield Middle_Initial}"}<space>{Mergefield Last_Name}

Replace <space> with real spaces


--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
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