Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Jonathan
 
Posts: n/a
Default Putting a dash between the zip code and the last four on a mail me

I am doing a mail merge from an Access database. My zip code field has the
normal five digits for a zip code but sometimes has the last four digits as
well. However, I need a dash between these two when the last four digits are
there. I have tried field codes and if then statements. Nothing seems to work.

Thanks!
  #2   Report Post  
Posted to microsoft.public.word.mailmerge.fields
macropod
 
Posts: n/a
Default mailmerge zip codes

Hi Jonathon,

Two deal with both zip formats, you'll need to add some tests to the
mergefields in word. There are two ways you could approach this:
1
.. copy the existing mergefield and make two copies of it, thus:
«ZipCode» «ZipCode» «ZipCode»
.. select the second field and press Ctrl-F9 to embed it in another field,
thus:
«ZipCode» { «ZipCode» } «ZipCode»
.. do the same with the third field, thus:
«ZipCode» { «ZipCode» } { «ZipCode» }
.. select all of these fields and press Ctrl-F9 again, to embed the lot in
another field, thus:
{ «ZipCode» { «ZipCode» } { «ZipCode» } }
.. within these fields, input the text as indicated:
.. select all of these fields and press Ctrl-F9 again, to embed the lot in
another field, thus:
{IF«ZipCode» 9999 {=«ZipCode» \# "00000'-'00000"} {=«ZipCode» \# 00000} }
2.
.. copy the existing mergefield and make two copies of it, thus:
«ZipCode» «ZipCode» «ZipCode»
.. select all of these fields and press Ctrl-F9 again, to embed the lot in
another field, thus:
{ «ZipCode» «ZipCode» «ZipCode» }
.. select the second field and press Shift-F9 to expose its coding, thus:
{ «ZipCode» { MERGEFIELD ZipCode} «ZipCode» }
.. do the same with the third field, thus:
{ «ZipCode» { MERGEFIELD ZipCode} { MERGEFIELD ZipCode } }
.. within these fields, input the text as indicated:
{IF«ZipCode» 9999 { MERGEFIELD ZipCode \# "00000'-'00000"} { MERGEFIELD
ZipCode \# 00000} }

In both cases, you need to be careful to maintain the spacing indicated
above.

Cheers


"Jonathan" wrote in message
...
I am doing a mail merge from an Access database. My zip code field has the
normal five digits for a zip code but sometimes has the last four digits

as
well. However, I need a dash between these two when the last four digits

are
there. I have tried field codes and if then statements. Nothing seems to

work.

Thanks!



  #3   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Graham Mayor
 
Posts: n/a
Default Putting a dash between the zip code and the last four on a mail me

See also http://www.gmayor.com/formatting_word_fields.htm

--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org


Jonathan wrote:
I am doing a mail merge from an Access database. My zip code field
has the normal five digits for a zip code but sometimes has the last
four digits as well. However, I need a dash between these two when
the last four digits are there. I have tried field codes and if then
statements. Nothing seems to work.

Thanks!



  #4   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Jonathan
 
Posts: n/a
Default mailmerge zip codes

Thank you!! I'm up and running

"macropod" wrote:

Hi Jonathon,

Two deal with both zip formats, you'll need to add some tests to the
mergefields in word. There are two ways you could approach this:
1
.. copy the existing mergefield and make two copies of it, thus:
«ZipCode» «ZipCode» «ZipCode»
.. select the second field and press Ctrl-F9 to embed it in another field,
thus:
«ZipCode» { «ZipCode» } «ZipCode»
.. do the same with the third field, thus:
«ZipCode» { «ZipCode» } { «ZipCode» }
.. select all of these fields and press Ctrl-F9 again, to embed the lot in
another field, thus:
{ «ZipCode» { «ZipCode» } { «ZipCode» } }
.. within these fields, input the text as indicated:
.. select all of these fields and press Ctrl-F9 again, to embed the lot in
another field, thus:
{IF«ZipCode» 9999 {=«ZipCode» \# "00000'-'00000"} {=«ZipCode» \# 00000} }
2.
.. copy the existing mergefield and make two copies of it, thus:
«ZipCode» «ZipCode» «ZipCode»
.. select all of these fields and press Ctrl-F9 again, to embed the lot in
another field, thus:
{ «ZipCode» «ZipCode» «ZipCode» }
.. select the second field and press Shift-F9 to expose its coding, thus:
{ «ZipCode» { MERGEFIELD ZipCode} «ZipCode» }
.. do the same with the third field, thus:
{ «ZipCode» { MERGEFIELD ZipCode} { MERGEFIELD ZipCode } }
.. within these fields, input the text as indicated:
{IF«ZipCode» 9999 { MERGEFIELD ZipCode \# "00000'-'00000"} { MERGEFIELD
ZipCode \# 00000} }

In both cases, you need to be careful to maintain the spacing indicated
above.

Cheers


"Jonathan" wrote in message
...
I am doing a mail merge from an Access database. My zip code field has the
normal five digits for a zip code but sometimes has the last four digits

as
well. However, I need a dash between these two when the last four digits

are
there. I have tried field codes and if then statements. Nothing seems to

work.

Thanks!




  #5   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Jonathan
 
Posts: n/a
Default Putting a dash between the zip code and the last four on a mai

Thank you...everything was good but there was one too many zeros on the
00000-00000. It worked once I put 00000-0000. Otherwise it has an extra zero
in there. Thank you soo much though. I would have never figured it out
without you!

"Graham Mayor" wrote:

See also http://www.gmayor.com/formatting_word_fields.htm

--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org


Jonathan wrote:
I am doing a mail merge from an Access database. My zip code field
has the normal five digits for a zip code but sometimes has the last
four digits as well. However, I need a dash between these two when
the last four digits are there. I have tried field codes and if then
statements. Nothing seems to work.

Thanks!






  #6   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Graham Mayor
 
Posts: n/a
Default Putting a dash between the zip code and the last four on a mai

Damn! A typo. I'll fix that

--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org


Jonathan wrote:
Thank you...everything was good but there was one too many zeros on
the 00000-00000. It worked once I put 00000-0000. Otherwise it has an
extra zero in there. Thank you soo much though. I would have never
figured it out without you!

"Graham Mayor" wrote:

See also http://www.gmayor.com/formatting_word_fields.htm

--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org


Jonathan wrote:
I am doing a mail merge from an Access database. My zip code field
has the normal five digits for a zip code but sometimes has the last
four digits as well. However, I need a dash between these two when
the last four digits are there. I have tried field codes and if then
statements. Nothing seems to work.

Thanks!



Reply
Thread Tools
Display Modes

Posting Rules

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

Forum Jump


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