View Single Post
  #2   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Doug Robbins - Word MVP on news.microsoft.com Doug Robbins - Word MVP on news.microsoft.com is offline
external usenet poster
 
Posts: 407
Default How to format Zip Code from 9 to 5

As I do not think that it is possible to overcome this will formatting
switches, you might have merge to a new document letting the merge insert
the 75043-0000 or 75043--000 or 75043-000 and then use a Wildcard Replace
where you search for [-]{1,}[0]{3,} and leave the Replace with control
empty.

That will replace each of the 75043-0000 or 75043--000 or 75043-000 with
75043

--
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

"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?