Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #5   Report Post  
Posted to microsoft.public.word.mailmerge.fields
macropod[_2_] macropod[_2_] is offline
external usenet poster
 
Posts: 2,059
Default How to format Zip Code from 9 to 5

Hi Doug,

Your mission, if you choose to accept it, is to figure out how the code works ...

--
Cheers
macropod
[MVP - Microsoft Word]


"Doug Robbins - Word MVP on news.microsoft.com" wrote in message
...
I should have known that you would come up with a way of doing it.

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP, originally posted via msnews.microsoft.com

"macropod" wrote in message ...
Hi Leslie,

You can eliminate the unwanted portions via a field coded as:
{QUOTE{SET ID {MERGEFIELD ZipCode}}{SET EXP1{=-{=-{ID}-ID}/2}}{EXP1}}
Where 'ZipCode' is the name of the data field containing your Zip Codes.

With this coding, any of 75043-0000 or 75043--000 or 75043-000 will be returned as 75043.

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
[MVP - Microsoft Word]


"Leslie" wrote in message ...
I hope this makes sense! We have a glitch in our computer software that
automatically places zeros in the place of the zip code plus 4 numbers when
there are no numbers there, 75043-0000 or 75043--000 or 75043-000. Since we
do not have control over programming we need to overcome this problem,
hopefully, by using MS Word. We are okay with not seeing the plus four
numbers if they are there, because most often we only get the standard 5
numbers.

I have tried different formatting using Bookmarks, and this works if there
are only zeros in the plus 4 field, but if there ARE numbers what I get is
Word subtracting the plus four and creating a whole new zip code.

{IF {ZIP} 99999 "{ ZIP \# "00000'-'0000"}""{ZIP \# "00000"}"}
takes this number 75841-1111 and makes it 74730.

Is there any way to get Word to just truncate the last four numbers and only
show the first five?







 
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
My zip code format is lost when merging from Excel to Word... Roy Laws Microsoft Word Help 1 May 26th 21 09:31 PM
My zip code format is lost when merging from Excel to Word... Merging Zip Code Errors Microsoft Word Help 12 October 20th 09 09:46 PM
My zip code format is lost when merging from Excel to Word... MaggieDonuts Microsoft Word Help 2 June 5th 09 12:13 AM
Can I format zip code merge field to add hyphen if zip plus 4? ShaniraW Mailmerge 1 March 7th 06 07:36 PM
Mail Merge Zip Code will not format correctly ba Mailmerge 1 December 8th 04 02:15 AM


All times are GMT +1. The time now is 06:46 PM.

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"