View Single Post
  #3   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Geo 4[_2_] Geo 4[_2_] is offline
external usenet poster
 
Posts: 1
Default How do I avoid a blank line if a mail merge field is empty?

Thanks macropod. Your solution worked well.
Geo 4


"macropod" wrote:

Hi Geo 4,

In Word:
.. duplicate the mailmerge field for the line to be suppressed when there are no data (eg «MyData») so that you get «MyData»«MyData»;
.. select both fields and Press Ctrl-F9 to enclose them in a new field, thus { «MyData»«MyData» };
.. fill in between the braces so that you end up with {IF«myData»= "" "" "«MyData»¶
"}, where the '¶' is a paragraph mark or line-feed, depending on which you're using;
.. delete the existing paragraph mark or line-feed after the field;
.. position the cursor anywhere in this field and press F9 to update it;
.. run your mailmerge.

--
Cheers
macropod
[Microsoft MVP - Word]


"Geo 4" Geo wrote in message ...
Some addresses need only one line before the city and state, that is, they
only need an Address 1 field. Other addresses require two or even three
lines so I have had to create an Address 2 and an Address 3 field.
Unfortunately, this means that when an address that has no data in Address 2
or Address 3 prints, the program leaves two blank lines between the Address 1
line and the City/State line. Is there anyway to avoid the blanks lines so
that the City/State line will appear directly under the Address 1 line if
there is no data in Address 2 and 3?