Archive for March, 2013
Word 2010: Custom Date With Auto Month/Year, Blank Day
A member of the Windows 7 / Microsoft Office for Legal group on LinkedIn recently asked if there is a way to create a date code in which the month and year are codes that automatically update but there is a blank line where the user can type the day of the month manually.
My original method involved substituting some underscore characters for the “d” (the code for the day of the month) in the date code. This method worked fine, except that if the codes in the document were updated after the user had typed the day of the month, the manually typed day was erased and replaced by the underscore characters.
The method I detail in this post has the advantage that the underscore characters aren’t part of the field code at all. Rather, they are plain text. So the user can type over them and when the document field codes are updated, only the month and the year will update.
After setting up the date in this format (with an automatically updating code for the month, followed by underscores in plain text, followed by another automatically updating code for the year), you can create a Quick Part so that you can insert this specially formatted date into your document with just a few keystrokes.
First, let’s create the custom date.
- Insert a date code by doing one of the following:
> Clicking the Insert tab, Text group, Date & Time (choose the date format you want and make sure that “Update Automatically” is checked); or
> Pressing Alt Shift D (but note that this method might insert the date in a format not to your liking).
- Press Alt F9 to display the field code itself, not the code results. The code should look like this:
{ DATE \@ “MMMM d, yyyy”}
- Press the spacebar, type a few underscore characters and a comma, and press the spacebar again.
- Then insert a second date code. You should see something like this:
{ DATE \@ “MMMM d, yyyy”} _____, { DATE \@ “MMMM d, yyyy”}
- Insert your cursor into the first date code and delete everything after MMMM except the close quotation marks and the close bracket. The result should look like this:
{ DATE \@ “MMMM”}
- Insert your cursor into the second date code and delete everything between the open quotes and yyyy. The result should look like this:
{ DATE \@ “yyyy”}
- Press Alt F9 again to display the code results, i.e., the date. You should see something like this:
March _____, 2013
When you click in the month or the year, it should appear in gray, indicating that it is a code.
Now set up a Quick Part (Building Block) so that you can insert your modified date code with a few keystrokes. To do so:
- Select (highlight) the entire date, from the month through the year. In other words, include both date codes and the plain text in between.
- With the date selected, press Alt F3, and when the Create New Building Block dialog opens, give the entry a name (such as Month & Year).
- Optional Step: Type a description if you wish – something that might help you identify the Quick Part in the Building Blocks Organizer later on.
- Click OK to save your new Quick Part.
- To expand the Quick Part, start typing the name you gave it and press F3, which is the expander key.
CAUTION: When exiting out of Word, you will be prompted to save your new Quick Part. Be sure to click “Yes” or “OK” (I can’t recall the exact wording of the prompt), or the Quick Part will not be saved when you close out of Word!