Please Note: This article is written for users of the following Microsoft Word versions: 97, 2000, 2002, and 2003. If you are using a later version (Word 2007 or later), this tip may not work for you. For a version of this tip written specifically for later versions of Word, click here: Maintaining Leading Zeroes.

Maintaining Leading Zeroes

Written by Allen Wyatt (last updated September 10, 2022)
This tip applies to Word 97, 2000, 2002, and 2003


Suzanne has an Excel worksheet containing addresses. The ZIP Codes are formatted via the special Excel formatting that maintains leading zeroes. However, when she uses mail merge in Word, the leading zeroes are dropped.

There are several ways you can approach this problem. You could, for instance, go into Excel and create a new column that contains text versions of the numeric ZIP Codes. Here's a handy Excel formula to use to accomplish this:

=RIGHT("00000" & A1, 5)

If you put this formula in a column that has been formatted as text (and the ZIP Code is in cell A1), you end up with text that contains the leading zeroes. You can then use this new column in your merge in Word.

If you don't want to edit the original Excel data, then you should stick with making your changes in the Word merge document. Take a look at the document; it contains merge fields that indicate where the merged data will be placed. These fields also indicate how the merged data should be treated. If you select the merge field for the ZIP Code, you can expand it by pressing Shift+F9. You should see the underlying code that makes up the field. You can then modify the field code so it looks similar to this:

{ MERGEFIELD "Zip" \# 00000-0000 }

The name within the quote marks ("Zip") may well be different; it represents the name of the column in the Excel worksheet that needs to be merged. The important part is to add the formatting switch (\#) followed by the pattern to be used for formatting the merged data. When you are done making the change to the field, you can press Shift+F9 again to collapse the field, and then do your merge.

WordTips is your source for cost-effective Microsoft Word training. (Microsoft Word is the most popular word processing software in the world.) This tip (324) applies to Microsoft Word 97, 2000, 2002, and 2003. You can find a version of this tip for the ribbon interface of Word (Word 2007 and later) here: Maintaining Leading Zeroes.

Author Bio

Allen Wyatt

With more than 50 non-fiction books and numerous magazine articles to his credit, Allen Wyatt is an internationally recognized author. He is president of Sharon Parq Associates, a computer and publishing services company. ...

MORE FROM ALLEN

Updating to Smart Quotes

As you type a document, Word automatically converts your quote marks and apostrophes to "curly" versions that look more ...

Discover More

Moving Images Behind Text

When positioning images in a document, you may want them to appear behind text, so that the text shows up over the top of ...

Discover More

Understanding Default Insert Date Formatting

Insert a date into Word, and you are presented with a variety of formats you can choose from for that date. The default ...

Discover More

Do More in Less Time! Are you ready to harness the full power of Word 2013 to create professional documents? In this comprehensive guide you'll learn the skills and techniques for efficiently building the documents you need for your professional and your personal life. Check out Word 2013 In Depth today!

More WordTips (menu)

Controlling Date Formats in a Mail Merge

One of the data sources that Word allows you to use for your mail merges is an Excel worksheet. You may get unexpected ...

Discover More

Can't Merge Alphanumeric Data Correctly

When you merge data from Excel into a Word document, you may need to do some conditional processing based on the data you ...

Discover More

Wrong Values Merged from Excel

When you use an Excel workbook as a data source for your merged document, you may be surprised if what is merged doesn't ...

Discover More
Subscribe

FREE SERVICE: Get tips like this every week in WordTips, a free productivity newsletter. Enter your address and click "Subscribe."

View most recent newsletter.

Comments

If you would like to add an image to your comment (not an avatar, but an image to help in making the point of your comment), include the characters [{fig}] (all 7 characters, in the sequence shown) in your comment text. You’ll be prompted to upload your image when you submit the comment. Maximum image size is 6Mpixels. Images larger than 600px wide or 1000px tall will be reduced. Up to three images may be included in a comment. All images are subject to review. Commenting privileges may be curtailed if inappropriate images are posted.

What is one less than 9?

There are currently no comments for this tip. (Be the first to leave your comment—just use the simple form above!)


This Site

Got a version of Word that uses the menu interface (Word 97, Word 2000, Word 2002, or Word 2003)? This site is for you! If you use a later version of Word, visit our WordTips site focusing on the ribbon interface.

Videos
Subscribe

FREE SERVICE: Get tips like this every week in WordTips, a free productivity newsletter. Enter your address and click "Subscribe."

(Your e-mail address is not shared with anyone, ever.)

View the most recent newsletter.