Performing a Mail Merge in Microsoft Word using an Excel spreadsheet as the recipient data source frequently corrupts formatted postal codes, zip codes, and account numbers. Values such as 01234 in Excel suddenly appear as 1234 in merged Word documents, stripping critical leading zeros. This failure occurs because Word connects to Excel via OLE DB by default, reading raw numeric cell values rather than formatted text strings.
Add a Numeric Picture Switch (\#) to the Mergefield
The most reliable method to force Word to render leading zeros is editing the field code directly in your template:
- In your Word template, press Alt + F9 (or Option + F9 on Mac) to toggle field code view.
- Locate your merge field:
{ MERGEFIELD PostalCode }. - Insert a numeric picture format switch inside the curly braces:
{ MERGEFIELD PostalCode \# "00000" } - For 5-digit postal codes, use five zeros; for 9-digit account IDs, use nine zeros.
- Press Alt + F9 again to hide field codes, then press F9 to update the preview. Leading zeros will now display perfectly across all merged records.
Connect to Excel via Dynamic Data Exchange (DDE)
Configuring Word to connect via DDE forces Word to import formatted strings exactly as they render inside Excel:
- In Word, click File > Options > Advanced.
- Scroll down to the General section and check Confirm file format conversion on open. Click OK.
- In the Mailings tab, click Select Recipients > Use an Existing List… and select your Excel workbook.
- In the Confirm Data Source dialog that appears, click Show all, select MS Excel Worksheets via DDE (*.xls), and click OK.
Format Excel Column as Text Prior to Merging
In Excel, select your postal code column, set the number format to Text, or prepend an apostrophe ('01234) to ensure data is stored as a character string rather than a 32-bit integer.