MAIL MERGE ZIP

N

Nancy

I have an Excel file set up with the zip codes formatted
to add the 0 in front of zip codes starting with zero.
The merge in Word does not pick up this zero. How do I
get it to merge with the zero?
 
P

Peter Jamieson

You have to use a format switch in the Word merge field, e.g. use Alt-F9 to
view the field codes, then change

{ MERGEFIELD Zip }

to

{ MERGEFIELD Zip \#"00000" }

for a 5-digit Zip. If you also have 9-digit Zip codes and Word sees them as
9-digit numbers (without a "-") then you should be able to use

{ IF { ={ MERGEFIELD Zip }-100000 } > 0
"{ MERGEFIELD Zip \#"00000'-'0000" }"
"{ MERGEFIELD Zip \#"00000" }" }

where all the {} are the special field code braces you can insert using
ctrl-F9
 
D

Doug Robbins - Word MVP - DELETE UPPERCASE CHARACT

Hi Joseph,

The way in which Peter described is the way to do it.

Please post any further questions or followup to the newsgroups for the
benefit of others who may be interested. Unsolicited questions forwarded
directly to me will only be answered on a paid consulting basis.
Hope this helps
Doug Robbins - Word MVP
 
P

Peter Jamieson

If you have Zip codes that are blank or 0 and you want them to be completely
blank, then you need to add fields that test for blank/zero and insert
nothing. e.g. something like

{ IF { MERGEFIELD Zip } = "" ""
"{ IF { ={ MERGEFIELD Zip }-100000 } > 0
"{ MERGEFIELD Zip \#"00000'-'0000" }"
"{ MERGEFIELD Zip \#"00000" }" }" }

or

{ IF { MERGEFIELD Zip } = "0" ""
"{ IF { ={ MERGEFIELD Zip }-100000 } > 0
"{ MERGEFIELD Zip \#"00000'-'0000" }"
"{ MERGEFIELD Zip \#"00000" }" }" }
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top