Microsoft KB Archive/59019

{|
 * width="100%"|

WD: Creating Custom Date Formats with Glossary or AutoMac

 * }

Q59019

-

The information in this article applies to:


 * Microsoft Word for Windows, versions 6.0, 6.0a, 6.0c
 * Microsoft Word for Windows, versions 7.0, 7.0a
 * Microsoft Word for the Macintosh, versions 4.0, 5.0, 5.1, 6.0, 6.0.1, 6.0.1a

-

SUMMARY
In Microsoft Word, you can create custom date formats. To create a custom date format, see the section in the &quot;More Information&quot; section of this article that applies to your version of Word.

Word Versions 6.x, 7.x
Word inserts the date using the DATE field. You can add switches to the DATE field to customize the date format. To insert a date and insert switches to control the date format:

 On the Insert menu, click Field. Click the Date and Time category on the left. Under Field Names, click Date, then click Options. In the Field Options dialog box, click the General Switches tab. Select a date format from the Date-Time list box and click the Add to Field button. Click OK.  Click OK.

In the following example, the date field code     DATE \@ &quot;dd MMMM yyyy&quot; returns "12 July 1994" The &quot;dd&quot; switch returns &quot;12&quot;, the &quot;MMMM&quot; switch returns the month July, and &quot;yyyy&quot; returns the year 1994. 

To store the date field as an AutoText entry do the following:


 * 1) Select the date field.
 * 2) On the Edit menu, click AutoText.
 * 3) Type a name for the AutoText Entry and click Add.

In Word 6.x for more information on the date switches, do the following:


 * 1) Click Search for Help On the Help menu.
 * 2) Type general switches and click Show Topics.
 * 3) Click General Switches for Fields and click Go To.
 * 4) Click Date-Time Picture @

In Word 7.x for more information on the date switches, do the following:


 * 1) On the Help menu, click Microsoft Word Help Topics.
 * 2) Type general switches and click Show Topics.
 * 3) Click General Switches and click Display.
 * 4) Click Date-Time Picture @.
 * 5) Clcik Date instruction.

Word Version 5.x
Word 5.0 has special predefined glossary entries so you can easily create custom date formats. To create a custom date format in Word 5.0, do the following:


 * 1) On the Edit menu, click Glossary.
 * 2) Select the glossary entry of the item to be inserted and click the Insert button. For example the Print Day Of Month item inserts the current day in the document.

NOTE: If you want the date to always update, select glossary entries preceded by the word &quot;print.&quot;
 * 1) Repeat steps 1-2 as many times as necessary to insert various formats.

NOTE: Once you create the date format, you can make it into a glossary entry and insert it anywhere in the document.

To use the newly created format as a glossary entry, do the following:


 * 1) Select the newly created date.
 * 2) On the Edit menu, click Glossary.
 * 3) Type a name for this glossary entry.
 * 4) Click the Define button.

NOTE: Save your changes to the glossary when you finish editing.

Word Version 4.0
You can use AutoMac to insert a European-style date (a day, year, month format, such as 5 September 1990) by modifying the Word standard Glossary format &quot;Date-Now-Long.&quot;

To create an AutoMac macro that inserts the European date format, make sure AutoMac III is properly installed, then do the following:


 * 1) On the File menu, click New.
 * 2) Click the A in the upper-left corner of the window to bring up the main AutoMac dialog box. Click the Record button.
 * 3) Type a key combination and a name for the macro (for example, &quot;Date-Now-European&quot;). Click the Record button.
 * 4) Press the RETURN key.
 * 5) Press COMMAND+K to bring up the Glossary dialog box.
 * 6) Press the DOWN ARROW key enough times to select the &quot;Date-Now-Long&quot; entry. Press RETURN to insert it.
 * 7) Press COMMAND+OPTION+APOSTROPHE ('). The word &quot;More&quot; should appear in the lower-left corner of the window.
 * 8) To move to the start of the line, type K.
 * 9) On the numeric keypad, press the MINUS SIGN key . The words &quot;Extend to&quot; should appear in the lower-left corner of the window.
 * 10) Press the SPACEBAR once to extend the selection to the first space in the line.

NOTE: Skip step 11 if you do not want to insert the day of the week. Some Macintosh computers have been configured to suppress the day of the week for the long date format.
 * 1) Press the DELETE key once (to delete the selection).
 * 2) On the numeric keypad, press the MINUS SIGN key. The words &quot;Extend To&quot; should appear in the lower-left corner of the window.
 * 3) Press the SPACEBAR once to extend the selection to the next space in the line (that is, the space after the month).
 * 4) Press COMMAND+X to cut the month.
 * 5) Press COMMAND+RIGHT ARROW (to move past the day).
 * 6) Press the RIGHT ARROW key to move past the comma.
 * 7) Press the DELETE key to remove the comma and press the SPACEBAR to insert a space.
 * 8) Press COMMAND+V to paste the month.
 * 9) Press the DELETE key once to delete the extra space between the month and the year.
 * 10) Press COMMAND+OPTION+APOSTROPHE. The word &quot;More&quot; should appear in the lower-left corner of the window.
 * 11) To move to the start of the line, type K.
 * 12) Press the DELETE key once (to delete the initial carriage return).
 * 13) Click the A in the upper-left corner of the window to open the end of the recording AutoMac dialog box. Choose the Stop button.

To insert this date format, position the insertion point where the date is to appear, then press the key combination that was assigned to the macro in step 3 above.

Additional query words:

Keywords : kbfield winword macword word6 word7 word95

Issue type : kbhowto

Technology :