View Single Post
  #7   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

I have a word template stmt.dot containing salary informaion in two columns
in form of merge fields. The first column has labels (label1, lbel2,
label3,...labeln) and the second one has corresponding amounts (amount1,
amount2, amount3,.....amountn) I have just over 100 lines, each with a
corresponding label and amount. However for each stmt.dot printed not all
the merge fields are used. On average I use about 10 lines (10 labels fields
and 10 amount fields), not necessarily consecutive, in the template and the
rest appear as blank lines which I want to supress.

I have realines that ending each line by a paragraph mark will suppress the
baln merge files when I prin my template. I have manually added the
paragraph marks after a few lines and they seem to work. Now, when I add the
rest of the marks, the stsmt.dot does not retain them and therefore I end up
with a merged document of about two pages but with only 10 lines filed in
and spread over the two pages. I want the 10 lines to be only on one page
and the rest of the empty fields to be supressed. I do not mind inserting
the paragraph marks manually but the template does not keep them. That's why
I thought there should be a way to do it automatically and not loose the
marks.

Thanks in advance for your help



"Doug Robbins - Word MVP" a écrit dans le message
de news: ...
Your solution appears to be unrelated to the issue as you originally
described it.

It would probably be possible to use a macro to insert the carriage
returns, but you would have to give us more information on what you are
starting with to be able to provide some suggest code.

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP

"Tapiwa Jongwe" wrote in message
...
Hello there,

I found an easier way. Adding a paragraph markat the end of each line
will do the trick.

However when I edit my Word template to include the paragraph marks and
saving it, it does not keep them. How do I go about it and, aslo, is
there a way of automatically insterting the paragrapgh marks as I have
about a 100 lines if merge fields and would not like to edit them 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.