View Single Post
  #7   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Peter Jamieson Peter Jamieson is offline
external usenet poster
 
Posts: 4,582
Default Using an If Statement

1. let's try to go step by step.

The overview is that
a. your fields need to look like

{ IF "{ Nickname }" = "" "{ First Name }" "{ Nickname }" }

b. each pair of braces ( "{}" ) in there need to be the special field
braces that you can enter using ctrl-F9, not just the { and } characters you
can type on your keyboard. So e.g. you can do
ctrl-F9 to give you
{ }
then click inside those {} and type
IF "" = "" "" ""
to give you
{ IF "" = "" "" "" }

Then click between the first pair of "" and use ctrl-F9 again to give you

{ IF "{ }" = "" "" "" }

Then click inside the inner {} and type
Nickname

so you have

{ IF "{ Nickname }" = "" "" "" }

See where I'm going? Each pair of {} needs to be inserted using ctrl-F9.
Everything else is text you can enter on the keyboard. Also, you can use
Alt-F9 to "toggle" between a view where you see the field codes, or the
results of those field codes.

2. if your "Nickname" and "First Name" are actually columns in a mail merge
data source, then what you probably need is

{ IF "{ MERGEFIELD Nickname }" = "" "{ MERGEFIELD "First Name" }" "{
MERGEFIELD Nickname }" }

--
Peter Jamieson
http://tips.pjmsn.me.uk

"Amber" Amber @discussions.microsoft.com wrote in message
...
I am trying to do this it is not working for me. this is what I typed
{IF{Nickname}=blank,{First Name},{Nickname}} can you tell me what I am
doing
wrong please?

Thank you

"Graham Mayor" wrote:

Doug is correct, but he does have a tendency to assume a level of
knowledge
that the questioner may not have, and in this case I think you may be
stretched to work out what he meant here.

Press CTRL+F9 directly in the document, which will give you {}
Between the brackets type the text and insert the fields as he has shown,
or
if you prefer manually type in the fields with CTRL+F9 for each pair of
boundaries {}
Thus
{IF {Mergefield Title} = "" "{Mergefield Salutation2}" "{Mergefield
Salutation1}"}
Then with the cursor in the field press F9 to update. This should also
switch the display.

--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org


Kelly wrote:
I'm using Word 2003 and Windows XP. I have a merge document setup
and one of the fields is for the salutation. What I need to happen
at the merge is when it comes to the salutation field, if it is blank
then look to another field I have. so the statement should look
something like this:

if salutation1=blank,salutation2,salutation1

However, I cannot figure out how to get that statement in my
document. Any help would be appreciated.