Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Geo 4 Geo 4 is offline
external usenet poster
 
Posts: 1
Default How do I avoid a blank line if a mail merge field is empty?

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?
  #2   Report Post  
Posted to microsoft.public.word.mailmerge.fields
macropod[_2_] macropod[_2_] is offline
external usenet poster
 
Posts: 2,059
Default How do I avoid a blank line if a mail merge field is empty?

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?


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



  #4   Report Post  
Nuno Santos Nuno Santos is offline
Junior Member
 
Posts: 3
Default

Hi everyone,

sorry for digging this post, but i found it when i was trying to resolve the same thing, but when i use this, i no longer can see the fields when i'm preparing the document.

Any ideas? I'm using Word 2010.


Thanks,

Quote:
Originally Posted by macropod[_2_] View Post
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?
Reply
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
using word 2007 suppress blank line when merge field is empty Shelly Mailmerge 1 June 16th 08 08:18 PM
In Word 2003 when mail merge how do I delete an empty field? connie Mailmerge 3 July 23rd 07 05:25 PM
How do I avoid printing blank lines using mail merge in Word 2003. Printerb Mailmerge 1 April 15th 05 11:01 AM
line feed when merge field is blank Bev Mailmerge 1 March 22nd 05 10:31 PM
Word 2002 Mail Merge - merging to new doc displays blank empty dia Steve Vincent Mailmerge 1 December 15th 04 07:28 PM


All times are GMT +1. The time now is 03:13 PM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"