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
Peter Jamieson - 21 Jun 2005 17:52 GMT
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
>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
[quoted text clipped - 5 lines]
>
> Many thanks