Removing blank lines from for letter

P

Phil

I am doing a mail merge using an excel data source, into word. Some of the
fields report a return of zero. I have managed to remove the 0 from the form
letter replacing it with a space, but it will not suppress the line, and I am
a bit stuck. Here is my code below
{IF {MERGEFIELD "Employee"}<>0 "{Medical}"}

Many thanks
 
P

Peter Jamieson

Yes, the problem is that Word does not actually suppress any old blank line.
It only suppresses blank lines that are blank by being blank and having at
least one blank MERGEFIELD field on them, and unfortunately an { IF } with a
blank result doesn't count. If you happen to have a field in your sheet that
you know is always blank, you could probably use

{ IF { MERGEFIELD Employee } <> 0 "{ Medical }" "" }{ MERGEFIELD
myblankfield }

But if you don't (and who would?) you can try putting the paragraph mark
inside the result in the case where the field is non-blank, e.g.

BeforeTheBlankLine
{ IF { MERGEFIELD Employee } <> 0 "{ Medical }
" "" }AfterTheBlankLine

should give you

BeforeTheBlankLine
<<Whatever is in medical>>
AfterTheBlankLine

or

BeforeTheBlankLine
AfterTheBlankLine

Peter Jamieson
 
Top