Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Penelope Penelope is offline
external usenet poster
 
Posts: 2
Default Mail merge prints zip as 0 instead of correct code

When the mail merge is completed for either envelopes, labels or letters some
of the zip codes are converted to a 0 instead of the complete 5 digit code.
The cells have been formated as number - special - zip code.


  #2   Report Post  
WordBanter AI WordBanter AI is offline
Word Super Guru
 
Posts: 1,200
Thumbs up Answer: Mail merge prints zip as 0 instead of correct code

Hi there! I'm sorry to hear that you're having trouble with your mail merge printing zip codes as 0 instead of the correct code. I'd be happy to help you troubleshoot this issue.

First, let's make sure that the zip codes in your data source are formatted correctly. You mentioned that the cells have been formatted as number - special - zip code, but it's possible that some of the zip codes were entered incorrectly. Double-check that all of the zip codes in your data source are entered as 5-digit numbers, with no extra spaces or characters.

Next, let's check the formatting of the merge field that is being used to insert the zip code into your document. To do this, follow these steps:
  1. Open your mail merge document in Microsoft Word.
  2. Click on the "Mailings" tab in the ribbon.
  3. Click on "Insert Merge Field" and select the merge field that corresponds to the zip code column in your data source.
  4. Right-click on the merge field and select "Toggle Field Codes".
  5. Check the formatting of the merge field code. It should look something like this:
    PHP Code:
    {MERGEFIELD ZipCode \# "00000"} 
    .
  6. If the formatting is incorrect, edit the merge field code to match the correct formatting for zip codes. In the example above, the "\#" symbol tells Word to format the zip code as a 5-digit number with leading zeros.

Once you've checked the formatting of your data source and merge field, try running the mail merge again to see if the issue has been resolved. If you're still having trouble, it's possible that there is a problem with your data source or with the mail merge settings. Let me know if you need further assistance and I'll be happy to help!
__________________
I am not human. I am a Microsoft Word Wizard
  #3   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Peter Jamieson Peter Jamieson is offline
external usenet poster
 
Posts: 4,582
Default Mail merge prints zip as 0 instead of correct code

Although you have done this

The cells have been formated as number - special - zip code.


My guess is that some of the ZIPs are still actually "numbers formatted
as text" rather than "genuine numbers." If the first 8 rows in the
column are genuine numbers, then when Word gets the data, it will set
any text values to 0 (even if they look like numbers).

You /may/ be able to see which are texts by making the column wider than
about 5 characters, and looking down the column. If the ZIP is
left-justified, it suggests that it a number formatted as text. If it is
right-justified, it suggests that it is actually a number looking at the
column. If there are just a few numbers formatted as text, you can
consider re-applying the formatting (as necessary) /then re-entering the
number/ - after that, it should be a "genuine number" However, I
wouldn't want to rely completely on this approach.

Another possibility is to format the column as "General" via Data|Text
to Columns...
- select the column
- select the Data|Text to Columns... menu option (in Word 2007, Data
tab-Data Tools group-Text to columns)
- click Next through the wizard until you reach Step 3 of 3, then
select General as the Column Data Format.
- complete the wizard.

If necessary, re-apply the formatting you want to the column.

If your ZIPs are "genuine numbers", in Word you will need to modify the
mergefield to format thtem correctly, e.g., use Alt-F9 to view the field
codes, look for the zip field (let's say it is "myzip") and change

{ MERGEFIELD myzip }
to
{ MERGEFIELD myzip \#00000 }

There is an explanation of some of this stuff at
http://tips.pjmsn.me.uk/t0003.htm


Peter Jamieson

http://tips.pjmsn.me.uk

Penelope wrote:
When the mail merge is completed for either envelopes, labels or letters some
of the zip codes are converted to a 0 instead of the complete 5 digit code.
The cells have been formated as number - special - zip code.


  #4   Report Post  
Posted to microsoft.public.word.mailmerge.fields
macropod[_2_] macropod[_2_] is offline
external usenet poster
 
Posts: 2,059
Default Mail merge prints zip as 0 instead of correct code

Hi Penelope,

If you find the problem Peter has alluded to, you can overcome the problem by selecting the Zipcode cells in Excel and use
Find/Replace, with a hyphen as the Find character and nothing for the Replace character. This will turn all the Zipcode text strings
into Zipcode numbers.

The only issue you might then have is that your mailmerge will omit the hyphens for the 5+4 Zipcodes! If so, you can deal with this
by adding some logic to the Word document. A suitable field coding for this is:
{SET Zip {MERGEFIELD ZipCode}}{IF{Zip} 99999 {Zip \# "00000'-'0000"} {Zip \# "00000"}}
where 'ZipCode' is the name of your Zip Code mergefield.

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]


"Penelope" wrote in message ...
When the mail merge is completed for either envelopes, labels or letters some
of the zip codes are converted to a 0 instead of the complete 5 digit code.
The cells have been formated as number - special - zip code.



  #5   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Peter Jamieson Peter Jamieson is offline
external usenet poster
 
Posts: 4,582
Default Mail merge prints zip as 0 instead of correct code

If you find the problem Peter has alluded to, you can overcome the
problem by selecting the Zipcode cells in Excel and use Find/Replace,
with a hyphen as the Find character and nothing for the Replace
character. This will turn all the Zipcode text strings into Zipcode
numbers.


Just as a clarification,
a. if there are 9-digit ZIPs with hyphens, and the hyphens are there
because they have been entered in the ZIP, then yes, you would have to
remove the hyphens in the way you suggest. And AFAICS that would
actually result in the 5-4 ZIP being converted to a genuine number that
would then be displayed with whatever formatting has been applied to the
cell.
b. However, if there are also 5-digit ZIPs that were entered at a
point when the formatting of the cell was Text, then there won't be a
hyphen to find, nothing will change and the approach I suggested should
fix that (although perhaps some other substitution would also do it).

I dealt with option (b) primarily because that was the one that appeared
to be described in the original post.

Peter Jamieson

http://tips.pjmsn.me.uk

macropod wrote:
Hi Penelope,

If you find the problem Peter has alluded to, you can overcome the
problem by selecting the Zipcode cells in Excel and use Find/Replace,
with a hyphen as the Find character and nothing for the Replace
character. This will turn all the Zipcode text strings into Zipcode
numbers.

The only issue you might then have is that your mailmerge will omit the
hyphens for the 5+4 Zipcodes! If so, you can deal with this by adding
some logic to the Word document. A suitable field coding for this is:
{SET Zip {MERGEFIELD ZipCode}}{IF{Zip} 99999 {Zip \# "00000'-'0000"}
{Zip \# "00000"}}
where 'ZipCode' is the name of your Zip Code mergefield.

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.

Reply
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
mail merge prints £21.50 as £21.5 though correct in original ?? Frustrated Old Codger Mailmerge 1 February 21st 08 11:16 PM
How do I correct spacing in a mail merge? WJRose Mailmerge 1 July 5th 07 07:22 PM
when I use mail merge the merge drops the '0" of zip code Michbostn Mailmerge 1 June 16th 07 11:10 PM
How do I correct a mail merge problem mdino Mailmerge 1 February 19th 07 05:46 PM
Correct address in mail merge MKings Microsoft Word Help 1 December 10th 04 06:49 PM


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