Please Note: This article is written for users of the following Microsoft Word versions: 2007, 2010, 2013, 2016, 2019, and Word in Microsoft 365. If you are using an earlier version (Word 2003 or earlier), this tip may not work for you. For a version of this tip written specifically for earlier versions of Word, click here: Controlling Date Formats in a Mail Merge.
Written by Allen Wyatt (last updated October 24, 2022)
This tip applies to Word 2007, 2010, 2013, 2016, 2019, and Word in Microsoft 365
David is performing a mail merge using data stored in an Excel workbook. Part of the information being merged is a date. The date is formatted correctly in Excel, but when it is merged into the Word document it loses the formatting. Specifically, it appears as "09-23-2018" but should look like "Sunday, 23 September 2018." David is wondering how to get the formatting on the date that he needs.
There are two things you can try. First, you could check to see what method Word is using to grab the information from the Excel workbook. The default data transfer method is OLE (object linking and embedding), which means that the data is transferred as raw data and Word does it's best to format what it fetches. You can change the data transfer method when you select the Excel workbook in the merge process. Word should display a dialog box that asks how you want to have the data transferred; you should select either a DDE transfer or the Excel by Conversion option.
If you don't see the dialog box, then it means you need to configure Word so that it will present the dialog box. Just exit from the merge and follow these steps:
Figure 1. The General section of the Advanced options of the Word Options dialog box.
If all this talk about conversion methods, OLE, DDE, and the rest has your head spinning, take a moment and breathe deeply. You are in luck; there is another way you can get the date format you want without worrying about any method of data transfer. You can add a formatting switch to the merge field used in your document. If you display the field codes (instead of their results), the field usually looks similar to this:
{ mergefield MyDate }
This presumes that the name of the data field, from Excel, is MyDate. You can modify the merge field so that it includes a formatting switch, in this manner:
{ mergefield MyDate \@ "dddd, dd MMMM yyyy" }
The use of the \@ characters indicate that what follows is a pattern for how the date should be formatted. In this case, the date will show similar to "Wednesday, 26 September 2018." Full information on how to put together the date patterns can be found at the Word MVP site, here:
https://wordmvp.com/FAQs/TblsFldsFms/DateFields.htm
WordTips is your source for cost-effective Microsoft Word training. (Microsoft Word is the most popular word processing software in the world.) This tip (6108) applies to Microsoft Word 2007, 2010, 2013, 2016, 2019, and Word in Microsoft 365. You can find a version of this tip for the older menu interface of Word here: Controlling Date Formats in a Mail Merge.
Comprehensive VBA Guide Visual Basic for Applications (VBA) is the language used for writing macros in all Office programs. This complete guide shows both professionals and novices how to master VBA in order to customize the entire Office suite for their needs. Check out Mastering VBA for Office 2010 today!
When you get ready to merge a document with a data source, you'll want to make sure that everything is "as expected" ...
Discover MoreWhen you merge information into a document, Word provides two different ways you can create your output. Here's an ...
Discover MoreWord allows you to merge information into a document from various sources such as an Excel worksheet. If you do, you may ...
Discover MoreFREE SERVICE: Get tips like this every week in WordTips, a free productivity newsletter. Enter your address and click "Subscribe."
2019-07-31 16:19:25
Les Abeyta
Hello. Thanks for this tip. I've tried the suggestions above but i am still having an issue.
I have a date i've formatted as a short date in my spreadsheet as 9/23/2014.
I've saved my spreadsheet.
I've opened my merge document and merged the specific field into my document. The date (formatted in the spreadsheet as 9/23/2014), comes into my document as 41905 (the unformated date).
I've edited the code to read MERGEFIELD Previous_Recorded_Doc_Date \@ "MM/dd/yyyy" however, i still get 41905.
This is happening randomly with SOME of my documents pulling the same merge field. It works in most but in some it does.
Any idea why?
thank you
Got a version of Word that uses the ribbon interface (Word 2007 or later)? This site is for you! If you use an earlier version of Word, visit our WordTips site focusing on the menu interface.
Visit the WordTips channel on YouTube
FREE SERVICE: Get tips like this every week in WordTips, a free productivity newsletter. Enter your address and click "Subscribe."
Copyright © 2024 Sharon Parq Associates, Inc.
Comments