Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.mailmerge.fields
David L[_2_] David L[_2_] is offline
external usenet poster
 
Posts: 1
Default cannot print the first zero in a zip code.

Merging from excel into word. I cannot print the first zero in a zip code. I
have formatted the excel file to print zip codes before I proceed to merge.
when I complete the merge the first zero is not there.
  #2   Report Post  
Posted to microsoft.public.word.mailmerge.fields
macropod[_2_] macropod[_2_] is offline
external usenet poster
 
Posts: 2,059
Default cannot print the first zero in a zip code.

Hi David,

You need to format the mailmerge field in Word to preserve the leading zeroes. If your zip codes are just the 5-digit form, you
could add a numeric picture switch to the mergefield. To do this:
.. select the field;
.. press Shift-F9 to reveal the field coding. It should look something like {MERGEFIELD ZipCode};
.. edit the field so that you get {MERGEFIELD ZipCode \# 00000};
.. position the cursor anywhere in this field and press F9 to update it;
.. run your mailmerge.

Otherwise, try the merge with the following field code. It 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 or is formatted as
a numeric string without hyphens.
{QUOTE{SET Zip {MERGEFIELD ZipCode}}
{IF{Zip} 99999 {SET Zip {Zip \# "00000'-'0000"}}}
"{=-{=-{Zip}-Zip}/2 \# 00000;;}{=-({Zip}*(-1)-Zip)/2 \# ;-0000;}"}
or
{QUOTE{SET Zip «ZipCode»}
{IF{Zip} 99999 {SET Zip {Zip \# "00000'-'0000"}}}
"{=-{=-{Zip}-Zip}/2 \# 00000;;}{=-({Zip}*(-1)-Zip)/2 \# ;-0000;}"}

Notes:
1. The field brace pairs (ie '{ }') for the above examples are created via Ctrl-F9 - you can't simply type them or copy & paste them
from this message. Likwise, you can't type or copy & paste the chevrons (ie '« »') - they're part of the actual mergefields, which
you can insert from the mailmerge toolbar.
2. Although I've laid out the field codes in the 2nd & 3rd example with line feeds for readability, you can omit them if you prefer
3. The above examples also assume your zip code data are in a field named ZipCode - modify as need to suit your requirements.

--
Cheers
macropod
[Microsoft MVP - Word]


"David L" David wrote in message ...
Merging from excel into word. I cannot print the first zero in a zip code. I
have formatted the excel file to print zip codes before I proceed to merge.
when I complete the merge the first zero is not there.


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
Feild Code in Print Preview Phild Mailmerge 6 March 14th 09 07:34 AM
How do I print a zip code on individual envelopes? Charyrl Microsoft Word Help 6 August 29th 07 03:58 PM
Is there any way to get label to print out in zip code order? jtkimi Microsoft Word Help 1 April 22nd 05 09:13 PM
How do I get the "0" to print in the zip code when mail merging f. Ragmop Microsoft Word Help 4 January 11th 05 09:51 PM
How do I use the PRINT field code to ... Dave Microsoft Word Help 3 December 13th 04 04:06 PM


All times are GMT +1. The time now is 08:22 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"