View Single Post
  #5   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Peter Jamieson Peter Jamieson is offline
external usenet poster
 
Posts: 4,582
Default Default to empty space when mailmerge field is blank

As posted, this statement has a " in the wrong place:

{IF {Mergefield ATTENTION} "" "{Mergefield ATTENTION"} " "}

should be

{IF {Mergefield ATTENTION} "" "{Mergefield ATTENTION}" " "}

However, in some circumstances you may need to quote the first mergefield -
I would probably do it as

{ IF "{ Mergefield ATTENTION }" "" "{ Mergefield ATTENTION }" "
" }

although the spaces before } and after { are not necessary in this case,
this layout is the same as the way Word does it.

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

"jayC" wrote in message
...
I copied the statement you suggested-less the outside braces- into the
field code for the field (edit field /advanced field properties/field
codes). I exchanged the word "fieldname" for the name of the database
field (ATTENTION).

Now every instance of the field, whether the field is blank or not,
displays: "ATTENTION}"

When alt-f9 is pressed, the following appears as the switch:

{IF {Mergefield ATTENTION} "" "{Mergefield ATTENTION"} " "}

Are you sure this statement is valid? I doesn t seem to create the
correct result.

Thanks





"Graham Mayor" wrote in message
...
Most people have the opposite problem However you can ensure you get
what yiou want if you use a conditional field construction
{IF {Mergefield Fieldname} "" "{Mergefield Fieldname"} " "}

--

Graham Mayor - Word MVP

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



jayC wrote:
I need to retain the blank space (such as: " ") when a
merge field in the database is empty to maintain form
spacing. Presently, all the other data changes position depending on
whether the particular field is blank or not. The merge field is on
one line, so if the field is empty all other lines in the document
are shifted up.

How do I accomplish defaulting to a blank space when field contents
are empty in mailmerge?

I am using Word 2007