View Single Post
  #2   Report Post  
Posted to microsoft.public.word.mailmerge.fields
macropod[_2_] macropod[_2_] is offline
external usenet poster
 
Posts: 2,059
Default Deleting blank lines in mail merge doc

Hi Tapiwa Jongwe,

The usual way to suppress blank lines in a mailmerge is to apply an IF test to the mergefields that might sometimes be empty. The
way to do this in Word is to-
.. duplicate the mailmerge field to be suppressed (eg «MyData») so that you get:
«MyData»«MyData»;
.. select both fields and Press Ctrl-F9, you'll get:
{ «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 that's outside the mergefield;
.. position the cursor anywhere in this field and press F9 to update it;
.. run your mailmerge.


--
Cheers
macropod
[MVP - Microsoft Word]


"Tapiwa Jongwe" wrote in message ...
Hi,

I have a mail merge document of about six pages whose data source is another word doc.

However, not all the merge fields contain data at any given time. Sometimes I have two fields on page one with data and one files
on page six with data. When I merge this info, I have five pages blank in between. How can I automatically delete these blank
lines each i do the merge?

Thanks in advance.