# Solved: Problem with retaining leading zero in mail merge.



## Leslie Scooter (Mar 25, 2008)

My Excel document of addresses includes a column labeled Zip which contains some zip codes with leading zeros.

My Word document includes a merge field titled Zip in the appropriate location in the address block.

The problem is with these leading zeros. Ive tried both including and omitting an apostrophe before the zero in the Excel document; neither gives the desired result. One way gives just a zero and the other gives the Zip Code without the leading zero. 

Could you please let me know what I should do differently to make this work? Your help is very much appreciated! Thanks!

Working in Window XP, Word 2002 and Excel 2002


----------



## Leslie Scooter (Mar 25, 2008)

bump


----------



## OBP (Mar 8, 2005)

Have you tried forcing an Excel Number format of "X" number of characters to the left of the decimal point?


----------



## jimr381 (Jul 20, 2007)

Change the format to text within Excel. Also look into searching on the mergeformat switch within MS Word. I used this previously to retain the leading zeros for merged data.


----------



## Leslie Scooter (Mar 25, 2008)

Thanks OBP and JIMR for your replys. (sorry not to respond more quickly but for some reason I didn't receive and email letting me know you had replied.)

OBP - please tell me how to "force an Excel Number format of "X" number of characters to the left of the decimal point." I know you can increase and decrease decimals but that is to the right of the decimal point.

JIMR - I did try changing the format to text in Excel but results were unchanged. Could you tell me more about "searching on the mergeformat switch within MS Word"?


----------



## OBP (Mar 8, 2005)

Leslie, select "Custom" instead of Number and enter 000000 
ie as many zeroes as you need.
See the attached sheet


----------



## jimr381 (Jul 20, 2007)

The problem exists in Word not excel. It drops the leading zeros for zip codes. I am about to head to lunch, but later on this afternoon I will look it up again for you and post a writeup on it.


----------



## OBP (Mar 8, 2005)

Pasting the data in to word preserves the leading zeroes of the Custom format I have used, I am not sure a bout mail merge though.


----------



## jimr381 (Jul 20, 2007)

Mergeformat was for character formatting. That must have been a different part of the lesson I was going to teach. Try this thread here for help.


----------



## Leslie Scooter (Mar 25, 2008)

Yeah!! - finally... got it to work! Changing the MergeField Code as your article suggested to { Mergefield ZipCode \# "00000" } and formatting the zip to a "special - zip" number did the trick! 

Thanks so much for your help - I really appreciate you folk's expertise.


----------



## jimr381 (Jul 20, 2007)

Not a problem, if you need further assistance feel free to post again.


----------

