Customize date merge fields word !

Mail Merge: Reformat Date, Time and Number fields imported from Excel

When date, time or number fields are imported from Excel to a Word mail merge document the formatting reverts to general format, as defined in the BIOS of your computer, eg date fields display as mm/dd/yy. You can reformat them in the Word mail merge document and the changes you make will remain in the document. Follow the steps outlined in this article to reformat them.

Date Fields imported from an Excel file to a Mail Merge document

In the Word mail merge document, select the imported date field.

Right click over the selected field and choose Edit Field... from the menu commands to open the Field dialogue box.

Click on the Field Codes button (bottom left of Field dialogue box)

At Advanced Field Properties (top right of dialogue box) you will see a box with information similar to the text below

MERGEFIELD StartDate

Type the following after the name of the field

\@ "dd-MMM-yy" to see date in the format 25-Feb-10\@ "dd/MM/yyyy" to see the date in the format 25/02/2010\@ "dd MMMM yyyy" to see the date in the format 25 February 2010\@ "dddd, dd MMMM yyyy" to see the date in the format Friday, 25 February 2010

There are others, experiment if you want other date formats.

The box should now look similar to this: MERGEFIELD StartDate \@ "dd-MMM-yy"

Click on the OK button on the Field dialogue box.

The document will remember the format you have given the date, so when you run the mail merge again you do not have to repeat the procedure.

Time Fields imported from an Excel file to a Mail Merge file

In the Excel document, make sure that the time is entered correctly, eg 13:45, you may find it formats itself as a date, in which case you should highlight all of the cells that will hold time values, click on the Format menu and select Cells. On the dialogue box with the number tab selected, choose the custom category and scroll through the custom formats and select hh:mm - this will format the time correctly.

In the Word document, select the imported time field.

Right click over the selected field and choose Edit Field... from the menu commands to open the Field dialogue box.

Click on the Field Codes button (bottom left of Field dialogue box)

At Advanced Field Properties (top right of dialogue box) you will see a box with information similar to the text below

MERGEFIELD Arrival Time

Type the following after the name of the field

\@ "HH:mm" to see time in the format 13:45\@ "HH:mm:ss" to see the time in the format 13:45:30\@ "h:mm AM\PM" to see the time in the format 1:45 PM\@ "h:mm:ss AM\PM" to see the time in the format 1:45:30 PMThe box should now look similar to this: MERGEFIELD Arrival Time \@ "HH:mm"

Click on the OK button on the Field dialogue box.

The document will remember the format you have given the time, so when you run the mail merge again you do not have to repeat the procedure.

Number Fields imported from an Excel file to a Mail Merge document

In the Excel document, make sure that the number is a numeric value, and not a text value.

In the Word mail merge document, select the imported number field.

Right click over the selected field and choose Edit Field... from the menu commands to open the Field dialogue box.

Click on the Field Codes button (bottom left of Field dialogue box)

At Advanced Field Properties (top right of dialogue box) you will see a box with information similar to the text below

MERGEFIELD HireFee

Type the following after the name of the field

\# "0.00" to see number in the format 1234.50

\# "#,##0.00;- #,##0.00" to see positive number in the format 1,234.50 and negative number in the format -1,234.50

\# "£#,##0.00;- £#,##0.00" to see positive number in the format £1,234.50 and negative number in the format -£1,234.50

The box should now look similar to this: MERGEFIELD HireFee \# "#,##0.00;- #,##0.00"

Click on the OK button on the Field dialogue box.

The document will remember the format you have given the number, so when you run the mail merge again you do not have to repeat the procedure.

Applies to: Word 2002, 2003 and 2007, does not apply to previous versions.