A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Word » Mailmerge
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

leading zeros in mail merge



 
 
Thread Tools Display Modes
  #1  
Old May 5th, 2010, 05:17 PM posted to microsoft.public.word.mailmerge.fields
DP
external usenet poster
 
Posts: 223
Default leading zeros in mail merge

Using 2007 Excel and 2007 Word
A co-worker has a name/addr file in Excel and formatted the zip column as
category, special 00000. Zip shows fine.

However when uses word mail merge to produce mailing labels, the leading
zeros are dropped.

What need to be done?

TIA
  #2  
Old May 5th, 2010, 09:06 PM posted to microsoft.public.word.mailmerge.fields
Peter
external usenet poster
 
Posts: 962
Default leading zeros in mail merge

I'm not an expert but i saw a while back a web site that dealt thoroughly
with just this question. I think the author was Graham Mayor. Someone here
will be able to give the link, or you could google his name plus "word format
switches".

Peter.

"dp" wrote:

Using 2007 Excel and 2007 Word
A co-worker has a name/addr file in Excel and formatted the zip column as
category, special 00000. Zip shows fine.

However when uses word mail merge to produce mailing labels, the leading
zeros are dropped.

What need to be done?

TIA

  #3  
Old May 5th, 2010, 09:21 PM posted to microsoft.public.word.mailmerge.fields
Cappy
external usenet poster
 
Posts: 6
Default leading zeros in mail merge



"dp" wrote:

Using 2007 Excel and 2007 Word
A co-worker has a name/addr file in Excel and formatted the zip column as
category, special 00000. Zip shows fine.

However when uses word mail merge to produce mailing labels, the leading
zeros are dropped.

What need to be done?

TIA

  #4  
Old May 5th, 2010, 09:24 PM posted to microsoft.public.word.mailmerge.fields
Cappy
external usenet poster
 
Posts: 6
Default leading zeros in mail merge

What you can do is select the cells with the zip codes in your database,
right click the mouse for a menu, select format cell, on the top tab select
number, then select special, then select zip code. This will format all 5
characters, even if they have leading zeros...

"dp" wrote:

Using 2007 Excel and 2007 Word
A co-worker has a name/addr file in Excel and formatted the zip column as
category, special 00000. Zip shows fine.

However when uses word mail merge to produce mailing labels, the leading
zeros are dropped.

What need to be done?

TIA

  #5  
Old May 5th, 2010, 09:58 PM posted to microsoft.public.word.mailmerge.fields
Peter
external usenet poster
 
Posts: 962
Default leading zeros in mail merge

Found the link...

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

"dp" wrote:

Using 2007 Excel and 2007 Word
A co-worker has a name/addr file in Excel and formatted the zip column as
category, special 00000. Zip shows fine.

However when uses word mail merge to produce mailing labels, the leading
zeros are dropped.

What need to be done?

TIA

  #6  
Old May 6th, 2010, 02:34 AM posted to microsoft.public.word.mailmerge.fields
macropod[_2_]
external usenet poster
 
Posts: 2,402
Default leading zeros in mail merge

Hi dp,

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]


"dp" wrote in message ...
Using 2007 Excel and 2007 Word
A co-worker has a name/addr file in Excel and formatted the zip column as
category, special 00000. Zip shows fine.

However when uses word mail merge to produce mailing labels, the leading
zeros are dropped.

What need to be done?

TIA


  #7  
Old May 6th, 2010, 03:13 PM posted to microsoft.public.word.mailmerge.fields
DP
external usenet poster
 
Posts: 223
Default leading zeros in mail merge

Thanks for taking time to reply. We did get this far with excel but after
the mail merge into Word labels, the zero dropped again.

"cappy" wrote:

What you can do is select the cells with the zip codes in your database,
right click the mouse for a menu, select format cell, on the top tab select
number, then select special, then select zip code. This will format all 5
characters, even if they have leading zeros...

"dp" wrote:

Using 2007 Excel and 2007 Word
A co-worker has a name/addr file in Excel and formatted the zip column as
category, special 00000. Zip shows fine.

However when uses word mail merge to produce mailing labels, the leading
zeros are dropped.

What need to be done?

TIA

  #8  
Old May 6th, 2010, 03:20 PM posted to microsoft.public.word.mailmerge.fields
DP
external usenet poster
 
Posts: 223
Default leading zeros in mail merge

Peter - I printed your answer
and Macropod - I've printed out the link you sent.
Thanks for the information we have to try these.

"macropod" wrote:

Hi dp,

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]


"dp" wrote in message ...
Using 2007 Excel and 2007 Word
A co-worker has a name/addr file in Excel and formatted the zip column as
category, special 00000. Zip shows fine.

However when uses word mail merge to produce mailing labels, the leading
zeros are dropped.

What need to be done?

TIA


.

  #9  
Old May 7th, 2010, 03:53 PM posted to microsoft.public.word.mailmerge.fields
DP
external usenet poster
 
Posts: 223
Default leading zeros in mail merge

Peter - found the zip info in gmayor link and looks sooo simple but I managed
to unsimplify it. I used the insert merge field button for the zip and tried
to edit that, then I was adding spaces where none were needed. Took Macropods
advise about Ctrl+f9 but this was adding another set of brackets. I either
got nothing or an invalid merge field message.

Finally I typed the info {MERGEFIELD ZIP\#"00000"} and used the Ctrl+f9 and
it worked! Thank you both



"dp" wrote:

Peter - I printed your answer
and Macropod - I've printed out the link you sent.
Thanks for the information we have to try these.

"macropod" wrote:

Hi dp,

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]


"dp" wrote in message ...
Using 2007 Excel and 2007 Word
A co-worker has a name/addr file in Excel and formatted the zip column as
category, special 00000. Zip shows fine.

However when uses word mail merge to produce mailing labels, the leading
zeros are dropped.

What need to be done?

TIA


.

  #10  
Old May 7th, 2010, 11:11 PM posted to microsoft.public.word.mailmerge.fields
Doug Robbins - Word MVP
external usenet poster
 
Posts: 8,239
Default leading zeros in mail merge

If you use Alt+F9 after inserting the merge field, the display of field
codes will be toggle on to reveal { MERGEFIELD "fieldname" } and then you
can add the formatting switch inside the closing }

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

"dp" wrote in message
...
Peter - found the zip info in gmayor link and looks sooo simple but I
managed
to unsimplify it. I used the insert merge field button for the zip and
tried
to edit that, then I was adding spaces where none were needed. Took
Macropods
advise about Ctrl+f9 but this was adding another set of brackets. I
either
got nothing or an invalid merge field message.

Finally I typed the info {MERGEFIELD ZIP\#"00000"} and used the Ctrl+f9
and
it worked! Thank you both



"dp" wrote:

Peter - I printed your answer
and Macropod - I've printed out the link you sent.
Thanks for the information we have to try these.

"macropod" wrote:

Hi dp,

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]


"dp" wrote in message
...
Using 2007 Excel and 2007 Word
A co-worker has a name/addr file in Excel and formatted the zip
column as
category, special 00000. Zip shows fine.

However when uses word mail merge to produce mailing labels, the
leading
zeros are dropped.

What need to be done?

TIA

.

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 07:14 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.