View Single Post
 
Old 05-30-2014, 01:26 AM
DHammer DHammer is offline Windows 7 64bit Office 2010 32bit
Novice
 
Join Date: May 2014
Posts: 1
DHammer is on a distinguished road
Default Suppress comma in "city , stat zip" line when blank

I am trying to use the Mail Merge in Word 2010 with an Excel 2010 spreadsheet to print a phone roster. Everything works fine except where for various reasons there in no city, state, or zip.

What I have in my mail merge document is:
<<Name>>
<<street>>
<<city>>, <<state>> <<Zip>>
<<Home TX>> / <<cell TX>>

<<Name>>
<<street>>
<<city>>, <<state>> <<Zip>>
<<Home TX>> / <<cell TX>>

<<Name>>
<<street>>
<<city>>, <<state>> <<Zip>>
<<Home TX>> / <<cell TX>>

<<Name>>
<<street>>
<<city>>, <<state>> <<Zip>>
<<Home TX>> / <<cell TX>>

In some of the "street" fields I have inserted the phrase "Withheld by Request" or "DECEASED" rather than a street address. The "City, State, and Zip" fields are then intentionally left blank in my spreadsheet.

What I get on the printout is :
John Doe
123 Any St.
Boston, MA xxxxx
(123) 456-7890 / (123) 123-4567

Jane Doe
DECEASED
,
/

Kelly Doe
Withheld by Request
,
/

Mike Doe
321 My Street
Sidney, NY xxxxx
(111) 222-3333 / (555) 666-7777

What I would like to have print out is the following:
John Doe
123 Any St.
Boston, MA xxxxx
(123) 456-7890 / (123) 123-4567

Jane Doe
DECEASED



Kelly Doe
Withheld by Request



Mike Doe
321 My Street
Sidney, NY xxxxx
(111) 222-3333 / (555) 666-7777

Where the ", " is NOT printed if the "city, state zip" fields are empty and the " / " does not print if one or both of the phone fields are blank.

Any or all suggestions would be appreciated. Right Now I am going through the generated document and manually having to delete or use the replace command to get rid of the unwanted characters.

Thanks!

Last edited by DHammer; 05-30-2014 at 01:40 AM. Reason: correct display error
Reply With Quote