Re: "remove blank lines"+"Mail Merge"
- From: Peter Jamieson <pjj@xxxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Thu, 05 Mar 2009 19:53:09 +0000
> Peter - if "don't print blank lines" is the default in MS Word 2007 id
> doesn't work very well - or MS Word doesn't consider a line with an
> IF-THEN-ELSE on it 'truly blank'.
No it doesn't. Nor are you the first person to notice :-) "don't print blank lines" is not a correct description of what is happening at all - if it was, presumably any blank line would be suppressed in the document, so clearly Word's code is only doing something special with lines that have fields on them that happen to end up blank. And even then, as you say, a line containing an IF field that results in a blank is not suppressed. Further, in recent versions of Word, even lines that would have been suppressed in earlier versions because they contained a single merge field whose result is blank are not suppressed if they are nested inside other fields sch as IF or INCLUDETEXT fields. Finally (I think!) there are differences in behaviour depending on whether you merge to a new document, preview, or print.
Typical Word, in fact.
But I think it would probably be easier for us if you could provide a bit more info including a sample of the relevant chunk of your text, as it looks as if you are trying to do something more complex than our simple suggestions could possibly deal with. I assumed from an earlier message that you were trying to output these amounts on seperate lines, but perhaps that isn't the case...
Peter Jamieson
http://tips.pjmsn.me.uk
John wrote:
Doug,.
Thanks. But it is still not working. I even tried to remove the spaces at the beginning of the line (which brought the 'columns' of salary data which were previously indented (on purpose) over to the left and there are still blank lines between the amounts. The text on the lines don't show- which is what I want - but the lines themselves still take up a 'line' on the document.
Peter - if "don't print blank lines" is the default in MS Word 2007 id doesn't work very well - or MS Word doesn't consider a line with an IF-THEN-ELSE on it 'truly blank'.
Thanks for your responses.
John
"Doug Robbins - Word MVP on news.microsof" wrote:
On the PREVIOUS line, put
{IF {MERGEFIELD merit_pay} > 0 "Merit ${MERGEFIELD merit_pay }" "" }
Then put the cursor between the " and the M of Merit and press Enter so that with Formatting marks being shown (Press the Show/Hide ¶ button), you see
Previous text { IF { MERGEFIELD merit_pay } > 0 "¶
Merit ${ MERGEFIELDmerit_pay }" "" }
Press Alt+F9 to toggle off the display of the field codes and then execute the merge.
--
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, originally posted via msnews.microsoft.com
"John" <John@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message news:2663CE40-5E14-4136-B09A-826D71DF454A@xxxxxxxxxxxxxxxxPeter and macropod,
Thanks. I tried both and I got 'closer' but MS Word 2007 wouldn't always
line the data up properly and other times it would throw an additional '$' on
the line.
I've seen several posts about a feature that perhaps other (prior) versions
of MS Word had and either 2007 hides it or I just can't find it. The feature
I wanted to try was a switch that said "Don't print blank lines". I've
searched high and low and can't seem to find that switch. I'm not saying it
would solve my problem but I would like to turn it on (if it exists in MS
Word 2007).
Many thanks.
--
John
"macropod" wrote:
Hi John,
You could use:
{IF«merit_pay»> 0 "«merit_pay»¶
"}
or:
{MERGEFIELD merit_pay \# "'Merit $',0.00¶
;;"}
where the '¶' is an actual carriage return or manual line-break.
--
Cheers
macropod
[MVP - Microsoft Word]
"John" <John@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message news:1DA0BAFD-28FF-4669-AD80-D090AB68035C@xxxxxxxxxxxxxxxxI've got a mail merge document that has a separate line for some numeric
amounts
(Base Pay, Adjustment, Merit Pay, etc.). The IF-THEN-ELSE statement I am
using works: ({IF {MERGEFIELD} merit_pay} > 0 "Merit ${MERGEFIELD}
merit_pay}"""}
but if merit_pay IS zero, it leaves a blank line in the document. How do I
get it to remove the blank line. The user wants all of the amounts to show,
on separate lines, lined up, but to not show any lines if there is no data on
that line AND she doesn't want the blank line to show either. She wants
subsequent lines to 'float up'.
--
John
- References:
- "remove blank lines"+"Mail Merge"
- From: John
- Re: "remove blank lines"+"Mail Merge"
- From: macropod
- Re: "remove blank lines"+"Mail Merge"
- From: John
- Re: "remove blank lines"+"Mail Merge"
- From: Doug Robbins - Word MVP on news.microsoft.com
- Re: "remove blank lines"+"Mail Merge"
- From: John
- "remove blank lines"+"Mail Merge"
- Prev by Date: can't find installable ISAM
- Next by Date: Re: "remove blank lines"+"Mail Merge"
- Previous by thread: Re: "remove blank lines"+"Mail Merge"
- Next by thread: Re: "remove blank lines"+"Mail Merge"
- Index(es):