Thread: If statements
View Single Post
  #4   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Doug Robbins - Word MVP Doug Robbins - Word MVP is offline
external usenet poster
 
Posts: 8,832
Default If statements

I missed a closing quote when typing the construction

{ IF { MERGEFIELD Prefix } "" "{ MERGEFIELD Prefix } { MERGEFIELD
"First_Name" }" "{ MERGEFIELD "First_Name" }" }

If the name of the field that contains the first name is two words,. use the
construction as shown above.


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

"dleo" wrote in message
...

It didn't work. Well, the data merges successfully, but there is no space
in
front of the first name no matter if there is a prefix or not. Also, my
first
name field is 2 words (FIRST NAME) so maybe that has something to do with
it.



"Doug Robbins - Word MVP" wrote:

Use the follwing field construction

{ IF { MERGEFIELD Prefix } "" "{ MERGEFIELD Prefix } { MERGEFIELD
FirstName }" "{ MERGEFIELD FirstName } }

You may need to change the Prefix and FirstName to the actual names of
your
fields.

You must use Ctrl+F9 to insert each pair of field delimiters { } and you
use
Alt+F9 to toggle off their display.

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

"dleo" wrote in message
...
Is there a way to use IF statements within a mail merge? I'm using an
excel
file as my data source. I have the prefix merge field, but about half
of
the
data entries have none. So when I merge in Word, the prefix field is
skipped
(as it should), but I still get that space in between where the prefix
would
go and the person's first name. Is there some sort of IF field where I
could
basically say "if there IS a prefix put in the space, but if there
isn't,
don't put a space."

I hope that makes sense.