My zip code format is lost when merging from Excel to Word...

G

Guest

I am merging addresses from Excel to Work and I lose zip code formatting
during the merge so that for all zip codes that begin with a zreo, the zero
is dropped. I have never had this problem before, how can I fix this?
Thanks!
 
G

Guest

I am also having the same problem.
I have changed the format to special>zip code when I merge, I do not get the
initial "0" in my zip code.
I change the format to text, and when I merge I only get the "0" without the
remaining digits in the zip code.
I entered the questioning zip codes with a ' prior to the 0 and when I merge
only the "0" without the remaining digits in the zip code show up.

Help?
 
S

Suzanne S. Barnhill

Did you look at the recommended Web page?

--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA

Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.
 
G

Guest

yes I have viewed both website suggestions and followed both advice, but it
is not showing the "0"
 
G

Graham Mayor

Did you update the field after adding the switch?

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP

My web site www.gmayor.com

<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 
G

Guest

I am having the same problem as Suzanne. I FOLLOWED THE POSTED DIRECTIONS!
How about a detailed example?
 
G

Graham Mayor

The use of zip codes formatting switches is explained in detail in my web
page http://www.gmayor.com/formatting_word_fields.htm

Essentially Word is expected to provide the formatting and will strip
leading zeros from numbers. You can use a number switch or mask to restore
that zero. At the place you want the zip code press CTRL+F9. This will give
you a pair of field brackets {}

Between the brackets type the required field data, presumably {Mergefield
Zip} then add the switch i.e.
{Mergefield Zip \# "00000"}. With the cursor in the field. Press F9 to
update. This should toggle the field display, but if it doesn't ALT+F9 will.

If you need one of the more complicated formatting options, see the web
page for the content.

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP

My web site www.gmayor.com

<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 
G

Guest

Graham Mayor said:
The use of zip codes formatting switches is explained in detail in my web
page http://www.gmayor.com/formatting_word_fields.htm

Essentially Word is expected to provide the formatting and will strip
leading zeros from numbers. You can use a number switch or mask to restore
that zero. At the place you want the zip code press CTRL+F9. This will give
you a pair of field brackets {}

Between the brackets type the required field data, presumably {Mergefield
Zip} then add the switch i.e.
{Mergefield Zip \# "00000"}. With the cursor in the field. Press F9 to
update. This should toggle the field display, but if it doesn't ALT+F9 will.

If you need one of the more complicated formatting options, see the web
page for the content.

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP

My web site www.gmayor.com

<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 
G

Guest

I have read the entire steam, carefully read your linked page, and also
checked & double checked my typing. I continue to get an error message that
the mergefield zip \# (the backslash doesn't show, though) is not found in
the header row of my database. Everything stops at that point.
 
S

Suzanne S. Barnhill

The "\# 00000" is a formatting switch. In the example, you must substitute
for "Zip" whatever is the name of the field in your database that contains
the ZIP code. The alternative is to link to the Excel file using DDE.

--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA

Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.
 
G

Guest

Dear Suzanne & Graham,
Yes, I did actually use the heading specific to my Excel datasheet, but for
simplicity didn't include it in my last message to this stream. My system
seems to be refusing to recognize the switch. Any ideas how to trick it into
recognizing it? What is a DDE?
 
G

Graham Mayor

Did you toggle the field to show {Mergefield Zip} rather than <<Zip>> before
adding the switch?
Did you update the field after adding the switch?
As for DDE - see the Excel data section of
http://www.gmayor.com/mail_merge_labels_with_word_xp.htm

DDE, when it works, will bring in the formatting from Excel - but it isn't
very reliable.

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP

My web site www.gmayor.com

<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 
S

Suzanne S. Barnhill

There are two ways to force Word to use the number formatting you have
applied in Excel. One is to use a formatting switch as described by Graham.
The other is to connect to Excel using DDE (the old method) instead of OLEDB
(the method introduced in Word 2002, which preserves Unicode characters but
not number formatting). To do the latter, you'll need to check the box for
"Confirm conversion at Open" on the General tab of Tools | Options. After
doing that, reattach the data source to your mail merge main document. When
you do, you'll get a dialog asking you to choose the connection method, and
you can choose DDE.

Also, I notice that Graham's reply suggests "{ Mergefield Zip \# "00000" }."
If I have correctly read Word's Help topic "Numeric Picture (\#) field
switch," the quotes around the numeric picture are unnecessary and perhaps
incorrect (and may be part of the problem).

--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA

Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.
 
G

Graham Mayor

The quotes should not cause a problem!

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP

My web site www.gmayor.com

<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 
G

Guest

Suzanne! Removing those quotation marks seems to have done the trick with
the 5-digit zip codes!! Hurray, we're half-way there. I've tried several
variations on the 9-digit portion of the coding, but get only five zeros to
show. I can remove the 4-digit extensions, but would much rather be able to
solve this once and for all. I really appreciate all your and Graham's help,
as I'm sure others will, too.
 
S

Suzanne S. Barnhill

If you have a mixture of 5-digit and 9-digit ZIPs, then you'd be better off
using DDE to connect.

--
Suzanne S. Barnhill
Microsoft MVP (Word)
Words into Type
Fairhope, Alabama USA

Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all may benefit.
 
G

Graham Mayor

My web page - http://www.gmayor.com/formatting_word_fields.htm shows how to
obtain 5 and 9 digit zips using switches. remember that you have to use
CTRL+F9 for each pair of field boundaries and then update the field. I don't
see why removing the quotes should make any difference (though the fields
were all tested on Word 2003). However if it works for you then remove
them -
{ IF{ Mergefield Zip } > "99999" "{ Mergefield Zip \# 00000'-'0000 }" "{
Mergefield Zip \# 00000 }" }
or if you want 9 digits for all
{ IF{ Mergefield Zip } > "99999" "{ Mergefield Zip \# 00000'-'0000 }" "{
Mergefield Zip \# 00000 }-0000" }

I have just tested this again and it works either with or without the
quotes.

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP

My web site www.gmayor.com

<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 
G

Guest

The postal code information should be stored as text in the data source, not
as a number. Enter the zipcode prefaced with a single quote.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top