Why Word Mail Merge Loses Postal Code Leading Zeros From Excel
🔍 WiseChecker

Why Word Mail Merge Loses Postal Code Leading Zeros From Excel

When you run a mail merge in Word using an Excel spreadsheet as the data source, postal codes that start with one or more zeros often appear without those leading zeros. A code like 01234 becomes 1234, which causes returned mail and delivery failures. This happens because Excel interprets postal code columns as numbers and strips leading zeros when Word reads the data. This article explains the root cause of the zero loss, provides two reliable methods to preserve the zeros, and covers what to do if the merge still shows incorrect data.

Key Takeaways: Preserve Postal Code Leading Zeros in Word Mail Merge

  • Format the Excel column as Text before entering data: Prevents Excel from converting the postal code to a number and stripping leading zeros.
  • Use the \# “00000” merge field switch in Word: Forces Word to display the number with five digits including leading zeros after the merge.
  • Connect to the Excel file using DDE (Dynamic Data Exchange): Tells Word to read the data exactly as formatted in Excel without any conversion.

ADVERTISEMENT

Why Excel Removes Leading Zeros From Postal Codes

Excel automatically treats any column that contains only digits as a numeric data type. When you type 01234 into a cell formatted as General or Number, Excel removes the leading zero and stores the value as the number 1234. This behavior is built into Excel’s default data handling and is not a bug.

When Word connects to an Excel file during a mail merge, it reads the underlying numeric value, not the original typed text. Word does not know that the number 1234 should have been 01234. The result is that every postal code starting with zero loses that zero in the merged document, envelope, or label.

The problem occurs in three common situations:

  • You typed postal codes into cells that were formatted as General or Number.
  • You imported a CSV file where Excel converted the postal code column to numbers.
  • You copied data from another source and pasted it into Excel without first formatting the column as Text.

Once Excel stores the postal code as a number, the zeros are gone permanently unless you re-enter the data. The fix must happen either before the data enters Excel or during the mail merge in Word.

Method 1: Format the Excel Column as Text Before Entering Data

This method prevents the problem from starting. You must set the column format before typing or pasting any postal codes.

  1. Open the Excel file
    Open the workbook that contains your address data.
  2. Select the entire postal code column
    Click the column header letter, for example column D, to select every cell in that column.
  3. Go to the Home tab and open the Format Cells dialog
    In the Number group, click the small arrow in the bottom-right corner. The Format Cells dialog opens.
  4. Choose Text as the category
    On the Number tab, select Text from the Category list. Click OK.
  5. Enter or paste the postal codes
    Type or paste the postal codes into the column. Excel now treats each entry as text and preserves all characters, including leading zeros.
  6. Save the workbook
    Press Ctrl+S to save the changes. Close the file.
  7. Run the mail merge in Word
    Open your Word document and connect to this Excel file. The postal codes appear with their leading zeros.

If you already have postal codes in the column and they have lost their zeros, you must re-enter them after formatting the column as Text. There is no automatic way to recover the zeros from a numeric value.

ADVERTISEMENT

Method 2: Use a Merge Field Switch in Word

If you cannot change the Excel file or the data is already numeric, you can fix the display inside Word using a numeric picture switch. This method works only when all postal codes have the same length, for example all five-digit ZIP codes.

  1. Open the mail merge main document in Word
    Open the document that contains the merge fields.
  2. Press Alt+F9 to show field codes
    The merge fields change from placeholders like «PostalCode» to field code syntax such as { MERGEFIELD PostalCode }.
  3. Locate the postal code merge field
    Find the field code for the postal code. It looks similar to { MERGEFIELD PostalCode }.
  4. Add the numeric picture switch
    Click inside the field code, just after the field name but before the closing brace. Type a space, then type: \# “00000”
    The full field code reads: { MERGEFIELD PostalCode \# “00000” }
  5. Press Alt+F9 again to hide field codes
    The merge field now shows the placeholder text again, but the switch is active.
  6. Preview the merge results
    Click Preview Results on the Mailings tab. Postal codes now display with five digits. A code stored as 1234 appears as 01234.

For Canadian postal codes with a letter-number format, this switch is not needed because Word reads them as text automatically. For ZIP+4 codes (nine digits), change the switch to \# “000000000”.

What to Do if Postal Codes Have Different Lengths

The numeric picture switch requires a fixed length. If your data contains both five-digit and nine-digit codes, use a different approach. Format the Excel column as Text before entering data (Method 1). Alternatively, add a new column in Excel that combines a text prefix with the postal code, for example =TEXT(A2,”00000″), and use that column in the merge.

Method 3: Connect to Excel Using DDE

DDE (Dynamic Data Exchange) forces Word to read the data exactly as it appears in the Excel cells, including text formatting. This method works even if the column is formatted as Text after the data was entered, because DDE reads the displayed value, not the underlying numeric value.

  1. Open the Word mail merge document
    Start the Mail Merge process from the Mailings tab.
  2. Select Recipients > Use an Existing List
    Browse to your Excel file and select it. Do not click Open yet.
  3. Click the arrow next to the Open button
    A small dropdown arrow appears next to the Open button in the file selection dialog.
  4. Choose Open with DDE
    From the dropdown list, select Open with DDE. Word connects to the Excel file using DDE.
  5. Select the worksheet or named range
    Choose the worksheet that contains your data and click OK.
  6. Complete the mail merge normally
    Insert merge fields and finish the merge. The postal codes retain their leading zeros.

DDE is an older technology and may not be available in all versions of Word. If you do not see the Open with DDE option, use Method 1 or Method 2 instead.

If the Mail Merge Still Loses Leading Zeros

Word Shows a Zero-Length Postal Code After the Merge

If the merged document shows a blank space or an empty field where the postal code should be, the Excel column may contain mixed data types. Some cells may be stored as text and others as numbers. Select the entire column in Excel, format it as Text, and re-enter any codes that lost their zeros. Then reconnect Word to the updated file.

The Merge Field Switch Does Not Add Zeros

If you added the \# “00000” switch but the postal code still appears without leading zeros, the source data may contain non-numeric characters such as spaces or hyphens. The numeric picture switch works only on pure numbers. Remove any extra characters from the Excel column or use Method 1 to store the data as text.

Word Displays the Field Code Instead of the Postal Code

If you see { MERGEFIELD PostalCode \# “00000” } in the merged document, the field code is toggled on. Press Alt+F9 to hide field codes and display the result. If the issue persists, the document may be in a mode that shows field codes permanently. Go to File > Options > Advanced, scroll to the Show document content section, and clear the Show field codes instead of their values check box.

Method When to Use Requirement
Format column as Text before data entry You are creating a new Excel file or re-entering data Column must be formatted before typing or pasting
Numeric picture switch in Word Data is already numeric and all codes have the same length Must know the exact digit length of the postal code
DDE connection from Word Column is formatted as Text but zeros were lost during import DDE option must be available in your Word version

You can now prevent or fix leading zero loss in postal codes during a Word mail merge. Start by formatting the Excel column as Text before entering data. If the data is already numeric, apply the \# “00000” merge field switch in Word or use DDE to connect. For data with mixed code lengths, add a helper column in Excel that converts numbers to text with the TEXT function. This approach keeps your mail merge output accurate and reduces returned mail.

ADVERTISEMENT