This is the relevant part of the site. You must toggle on the field codes
(Alt+F9) and add a formatting switch to force the display into the required
format.
US Zip Codes
Five digit zip codes are reported as dropping the leading zero when merging
from Excel/Access data files. A simple numeric switch should fix that one
{ MERGEFIELD Zip \# "00000" }
Formatting problem: the zip codes in my data source are 5-digit or 9-digit.
What I'd like to do is apply a number format that will convert all ZIP codes
to ZIP + four format, i.e. 12345 becomes 12345-0000, 123450000 becomes
12345-0000 and 123456789 becomes 12345-6789
This requires the use of a conditional field which tests whether the field
has five or nine digits then applies appropriate formats.
{ IF { MERGEFIELD Zip } > "99999" "{ MERGEFIELD Zip \# "00000'-'0000" }"
"{ MERGEFIELD Zip \# "00000" }-0000" }
Zip = 12345
12345-0000
Zip = 123456789
12345-6789
--
Please respond to the Newsgroup for the benefit of others who may be
interested. Questions sent directly to me will only be answered on a paid
consulting basis.
Hope this helps,
Doug Robbins - Word MVP