View Single Post
  #6   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Lester Lane Lester Lane is offline
external usenet poster
 
Posts: 2
Default How to I print only non-blank fields in Mail Merge?

On 30 June, 12:28, "macropod" wrote:
Hi Kathleen,

If you're wanting to skip the whole record when the specified field is empty, the approach suggested by Doug will work.

However, if you're just trying to hide the space taken up by an empty field when it's positioned between two others, you can use an
IF test coded along the lines of:

Empty Space Suppression-
. duplicate the mailmerge field to be suppressed (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 around the new field braces so that you end up with: {IF«MyData»= "" "" "«MyData» "};
. delete the space after the field.

Empty Line Suppression-
. duplicate the mailmerge field to be suppressed (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.

When you're done with the above:
. position the cursor anywhere in this field and press F9 to update it;
. run your mailmerge.

--
Cheers
macropod
[Microsoft MVP - Word]

"Kathleen" wrote in ...
I am using Word 2003. *I have my merged document and data fields. Some data
fields are empty and I do not wish to print those records when the fields are
empty. How can I do that?


Kathleen,
I re-read your question in less haste and realise I got the wrong end
of the stick! It is quite clear actually. I have fixed my issue with
an IF statement. Thanks all.