View Single Post
  #3   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Tapiwa Jongwe Tapiwa Jongwe is offline
external usenet poster
 
Posts: 6
Default Deleting blank lines in mail merge doc

Thanks I will try this. But I have over 200 merge fields, all starting with
the prefix "MF". At any one point not more than 10 fields will have data,
the rest will be blank. could there be a way to loop through all of them and
delete blank lines as it would be laborious and error prone to change the
200 fields one by one?

"macropod" a écrit dans le message de news:
...
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.