Default to empty space when mailmerge field is blank

J

jayC

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
 
G

Graham Mayor

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


<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 
J

jayC

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
 
D

Doug Robbins - Word MVP

You must use Ctrl+F9 to insert each pair of field delimiters { }. You
cannot insert them using the keys for those symbols directly from the
keyboard.

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

Peter Jamieson

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.
 

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