Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Mailmerge and Fax / October 2006

Tip: Looking for answers? Try searching our database.

If the mergefield is blank, delete the line.

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
diane@discussions.microsoft.com - 29 Oct 2006 03:07 GMT
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.
Signature

diane

Graham Mayor - 29 Oct 2006 06:52 GMT
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_labels_with_word_xp.htm  you should have
the option to suppress blank lines in addresses - but the former method is
simpler and more reliable.

Signature

<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor -  Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>

> I would like to print addresses.  All of the addresses do not have
> the same number of lines.
[quoted text clipped - 11 lines]
> the address looks like the second example.
> Many thanks.
diane@discussions.microsoft.com - 31 Oct 2006 07:06 GMT
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

Signature

diane

> You don't delete the line, but insert it only when it has content. Thus you
> need to conditionally insert the field eg
[quoted text clipped - 26 lines]
> > the address looks like the second example.
> > Many thanks.
Graham Mayor - 31 Oct 2006 07:09 GMT
You didn't use CTRL+F9 for the field boundarie pairs {}

Signature

<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor -  Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>

> Thank you, Graham.  I have inserted the line you suggested as follows:
> «ADDRESS»} {If{Mergefield Street_Address_3} <> "" "
[quoted text clipped - 50 lines]
>>> the address looks like the second example.
>>> Many thanks.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.