Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.mailmerge.fields
John John is offline
external usenet poster
 
Posts: 307
Default "remove blank lines"+"Mail Merge"

I'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
  #2   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Peter Jamieson Peter Jamieson is offline
external usenet poster
 
Posts: 4,582
Default "remove blank lines"+"Mail Merge"

You can try smething like the following instead:

{ MERGEFIELD merit_pay \#"'Merit $0.00';'';''" }

(You can adjust the '$0.00' part as necessary)

If you need the field to be inserted with its original formatting then
you need the IF, but if for example you want


A
Merit $whatever
B

when merit_pay 0 and

A
B

when it perit_pay = 0, you can use

A{ IF { MERGEFIELD merit_pay } 0 "
Merit ${ MERGEFIELD merit_pay }" "" }
B

i.e. click enter immediately before the "M" of "Merit to insert a
paragraph mark in the output of the IF field.


Peter Jamieson

http://tips.pjmsn.me.uk

John wrote:
I'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'.

  #3   Report Post  
Posted to microsoft.public.word.mailmerge.fields
macropod[_2_] macropod[_2_] is offline
external usenet poster
 
Posts: 2,059
Default "remove blank lines"+"Mail Merge"

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" wrote in message ...
I'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


  #4   Report Post  
Posted to microsoft.public.word.mailmerge.fields
John John is offline
external usenet poster
 
Posts: 307
Default "remove blank lines"+"Mail Merge"

Peter 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" wrote in message ...
I'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



  #5   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Doug Robbins - Word MVP on news.microsoft.com Doug Robbins - Word MVP on news.microsoft.com is offline
external usenet poster
 
Posts: 407
Default "remove blank lines"+"Mail Merge"

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" wrote in message
...
Peter 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" wrote in message
...
I'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







  #6   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Peter Jamieson Peter Jamieson is offline
external usenet poster
 
Posts: 4,582
Default "remove blank lines"+"Mail Merge"

In Word 2007 the option is set to "Don't print blank lines" by default.

But you can modify the setting either by putting the old Mail Merge
Helper in the QAT (Word Office Button-Word Options-Customize-Choose
commands from All Commands, locate Mail Merge Helper and drag it to the
right hand column) and using the third button, or by using VBA to issue

activedocument.MailMerge.SuppressBlankLines = True

(or False!)

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.


Do you actually have a variety of different formats of amount in your
data source (e.g. some with just 1.23, some with $1.23, etc.?)


Peter Jamieson

http://tips.pjmsn.me.uk

John wrote:
Peter 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.

  #7   Report Post  
Posted to microsoft.public.word.mailmerge.fields
John John is offline
external usenet poster
 
Posts: 307
Default "remove blank lines"+"Mail Merge"

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" wrote in message
...
Peter 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" wrote in message
...
I'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





  #8   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Peter Jamieson Peter Jamieson is offline
external usenet poster
 
Posts: 4,582
Default "remove blank lines"+"Mail Merge"

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" wrote in message
...
Peter 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" wrote in message
...
I'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



  #9   Report Post  
Posted to microsoft.public.word.mailmerge.fields
John John is offline
external usenet poster
 
Posts: 307
Default "remove blank lines"+"Mail Merge"

Peter,

No - they are all currency.

I did 'go back in' (this was this morning after the posts last night)
and set all the either blank or null fields to 0 (which show as $0)
thinking that may have had some effect on it (which, in reality it didn't
as both null and blank are NOT 0)

John
--
John


"Peter Jamieson" wrote:

In Word 2007 the option is set to "Don't print blank lines" by default.

But you can modify the setting either by putting the old Mail Merge
Helper in the QAT (Word Office Button-Word Options-Customize-Choose
commands from All Commands, locate Mail Merge Helper and drag it to the
right hand column) and using the third button, or by using VBA to issue

activedocument.MailMerge.SuppressBlankLines = True

(or False!)

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.


Do you actually have a variety of different formats of amount in your
data source (e.g. some with just 1.23, some with $1.23, etc.?)


Peter Jamieson

http://tips.pjmsn.me.uk

John wrote:
Peter 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.


  #10   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Doug Robbins - Word MVP on news.microsoft.com Doug Robbins - Word MVP on news.microsoft.com is offline
external usenet poster
 
Posts: 407
Default "remove blank lines"+"Mail Merge"

If you want to send me a copy of the mail merge main document, I will see
what I can do with it.

Send it to

You must delete REMOVECAPS from the email address.

--
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" wrote in message
...
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" wrote in message
...
Peter 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" wrote in message
...
I'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







Reply
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
email merge with multiple recipients in "To", "CC" & "BCC" Raghu Mailmerge 6 April 21st 23 12:58 PM
How do you print emails with headers ("From","To" &"Subject lines Paul@Roselands[_2_] Microsoft Word Help 4 December 28th 07 11:15 PM
Word 2007: "Keep with next" and "Widow Lines" features not workin Tina Microsoft Word Help 3 October 5th 07 07:18 AM
"mail merge" disappeared from "tools" menu janice Mailmerge 2 June 28th 07 12:44 AM
remove the "final with markup" and "read" views as defaults ahimsa42 Page Layout 3 November 9th 05 11:06 PM


All times are GMT +1. The time now is 12:27 AM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"