Please Note: This article is written for users of the following Microsoft Word versions: 2007, 2010, 2013, 2016, 2019, and Word in Office 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: Calculated Dates.
by Allen Wyatt
(last updated September 14, 2019)
John asked if there is a quick way to put a calculated date into a letter created in Word. He wanted to send out mail-merged letters with a date that is 30 days after the date on which the letters were created.
Unfortunately, there is no native way to do this in Word. For instance, there is no field code you can use to insert a calculated date. If you are using Excel or Access as your data source for the mail merge, the simplest solution may be to just add a field in the data source that shows the calculated date. (It is very easy to do this in both Excel and Access.) The data source field can then be placed in the mail-merge document and everything is set.
If you want to stick with Word and cannot modify the data source (perhaps someone else supplies it), then you can use a macro to insert the future date. The following VBA macro will do the trick:
Sub FutureDate() Selection.TypeText Text:=Format(Date + 30, "mmmm d, yyyy") End Sub
This macro determines today's date, adds 30 days to it, formats it as specified in the format string ("mmmm d, yyyy") and inserts it into the document. If you assign this macro to a shortcut key, you can quickly insert your future date whenever you want.
WordTips is your source for cost-effective Microsoft Word training. (Microsoft Word is the most popular word processing software in the world.) This tip (11556) applies to Microsoft Word 2007, 2010, 2013, 2016, 2019, and Word in Office 365. You can find a version of this tip for the older menu interface of Word here: Calculated Dates.
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!
Want to know the absolute value of a number? It's easy to derive in VBA by using the Abs function.Discover More
Need to have your macro copy a file from one place to another? It's easy to do using the FileCopy command, described in ...Discover More
One of the powerful programming structures provided in VBA allows you to conditionally execute commands. The If ... End ...Discover More
FREE SERVICE: Get tips like this every week in WordTips, a free productivity newsletter. Enter your address and click "Subscribe."
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.