Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
If the mergefield is blank, delete the line.
I would like to print addresses. All of the addresses do not have the same
number of lines. Name Address 1 Address 2 City, State, Zip Name Address 1 City, State Zip When Address 2 = N.A., I would like the merge to delete the line so the address looks like the second example. Many thanks. -- diane |
#2
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
If the mergefield is blank, delete the line.
You don't delete the line, but insert it only when it has content. Thus you
need to conditionally insert the field eg {Mergefield Name} {Mergefield Address1}{If{Mergefield Address2} "" " {Mergefield Address2}"} {Mergefield City} etc You can use the same method for as many fields as may be empty. Also if you use the old mailmerge helper - http://www.gmayor.com/mail_merge_lab...th_word_xp.htm you should have the option to suppress blank lines in addresses - but the former method is simpler and more reliable. -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org wrote: I would like to print addresses. All of the addresses do not have the same number of lines. Name Address 1 Address 2 City, State, Zip Name Address 1 City, State Zip When Address 2 = N.A., I would like the merge to delete the line so the address looks like the second example. Many thanks. |
#3
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
If the mergefield is blank, delete the line.
Thank you, Graham. I have inserted the line you suggested as follows:
«ADDRESS»} {If{Mergefield Street_Address_3} "" " {Mergefield Street_Address_3}"} «City_of_Residence» «State_of_Residence_Code», «Zip_Code» However, when I do the merge, this is what is happening: 268 Redding Road } {If{Mergefield Street_Address_3} "" " {Mergefield Street_Address_3}"} Atlanta Can you tell me what I've done wrong? Many thanks, Diane GA, 30319 -- diane "Graham Mayor" wrote: You don't delete the line, but insert it only when it has content. Thus you need to conditionally insert the field eg {Mergefield Name} {Mergefield Address1}{If{Mergefield Address2} "" " {Mergefield Address2}"} {Mergefield City} etc You can use the same method for as many fields as may be empty. Also if you use the old mailmerge helper - http://www.gmayor.com/mail_merge_lab...th_word_xp.htm you should have the option to suppress blank lines in addresses - but the former method is simpler and more reliable. -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org wrote: I would like to print addresses. All of the addresses do not have the same number of lines. Name Address 1 Address 2 City, State, Zip Name Address 1 City, State Zip When Address 2 = N.A., I would like the merge to delete the line so the address looks like the second example. Many thanks. |
Reply |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
double window envelope | Page Layout | |||
If...Then | Mailmerge | |||
leave a blank line when merging | Mailmerge | |||
mail merging formatted content | Mailmerge | |||
How to delete a line created by equal signs? It won't delete from | Microsoft Word Help |