Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.mailmerge.fields
flyguy flyguy is offline
external usenet poster
 
Posts: 1
Default zip code with leading zero ok in excel but mail merge has no zero

I am creating mailing labels using mail merge function. In Excel I have
formatted the a column as zip code, so it will enable leading zero. That
works fine, but when I do the mail merge, the zip codes do not have a leading
zero.
  #2   Report Post  
Posted to microsoft.public.word.mailmerge.fields
macropod[_2_] macropod[_2_] is offline
external usenet poster
 
Posts: 2,059
Default zip code with leading zero ok in excel but mail merge has no zero

Hi flyguy,

The following field code correctly formats 5-digit and 5+4-digit Zip Code data, even where the source data may have incorrect
formatting such as a hyphen followed by trailing 0s after plain 5-digit Zip Codes (eg because a db only accepts Zip Codes in the
5+4-digit format) or is formatted as a 5-digit or 9-digit string without hyphens. A data field named €˜ZipCode is assumed.

{QUOTE
{SET Zip {MERGEFIELD ZipCode}}
{IF{Zip} 99999 {SET Zip {Zip \# "00000'-'0000"}}}
"{=-{=-{Zip}-Zip}/2 \# 00000;;}{=-({Zip}*(-1)-Zip)/2 \# ;-0000;}"}

Note: The field brace pairs (ie '{ }') for the above example are created via Ctrl-F9 - you can't simply type them or copy & paste
them from this message.

--
Cheers
macropod
[Microsoft MVP - Word]


"flyguy" wrote in message ...
I am creating mailing labels using mail merge function. In Excel I have
formatted the a column as zip code, so it will enable leading zero. That
works fine, but when I do the mail merge, the zip codes do not have a leading
zero.


Reply
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Leading zero from Zip Code not print on Label Merge Steve Microsoft Word Help 6 October 21st 08 05:50 AM
How do I not drop the leading 0 in a zip code mail merge? kevin@pcg Mailmerge 2 April 16th 08 07:37 PM
My zip code field on the mail merge drops leading zeroes, why? PETEinBOSTON Mailmerge 1 March 2nd 07 05:01 PM
Mail merge drops leading zero from zip code 07001 comes out 7001 Carl Mailmerge 4 August 19th 05 06:20 PM
Mail Merge dropping leading zeroes from the zip code lbradsha@erols Mailmerge 1 May 12th 05 04:50 PM


All times are GMT +1. The time now is 11:36 AM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"