WD: Creating Custom Date Formats with AutoText and/or Toolbar
ID: Q176692
|
The information in this article applies to:
-
Microsoft Word 97 for Windows
-
Microsoft Word 98 Macintosh Edition
SUMMARY
In Word, you can insert a date using the DATE field. You can add switches
to the DATE field to customize the date format.
This article describes the following:
- how to create a custom date format in Word
- how to create an AutoText entry for a custom date format
- how to record a custom date format macro so that you can use a toolbar
button to insert the date
MORE INFORMATIONCreating a Custom Date Format in Word
To insert a date and add switches to control the date format, follow these
steps:
- On the Insert menu, click Field. Under Categories, click the Date and
Time. Under Field Names, click Date, and then click Options.
- Click the General Switches tab and under Date-Time, select a date
format, click Add to Field, and then click OK twice.
In the following example, the date field code
DATE \@ "dd MMMM yyyy"
returns:
12 July 1997
The "dd" switch returns "12," the "MMMM" switch returns the month
July, and "yyyy" returns the year 1997.
Creating an AutoText Entry for a Custom Date Format
To store the date field as an AutoText entry, follow these steps:
- In your document, select the date field that you inserted using the
steps in the previous section.
- On the Insert menu, point to AutoText, and then click New.
- Type a name for the AutoText Entry and then click OK.
Recording a Custom Date Macro to Insert the Date from a Toolbar Button
To record an "insert date" macro and assign it to a toolbar button, follow
these steps:
- On the Tools menu, point to Macro, and then click Record New Macro.
- Under Macro Name, type in a name for your macro and then click Toolbars.
- Drag your macro to a toolbar and then click Close to close the Customize
dialog box.
- On the Insert menu, click Field. Under Categories, click Date And Time.
Under Field Names, click Date, and then click Options.
- Click the General Switches tab and under Date-Time, select a date
format, click Add To Field, and then click OK twice.
- Click Stop Recording on the macro toolbar.
For more information about date field format switches, click the Office
Assistant, type "switches," click Search, click "general switches", click
Date-Time Picture, and then click Date Instructions.
NOTE: If the Assistant is hidden, click the Office Assistant button on the
Standard toolbar. If Word Help is not installed on your computer, please
see the following article in the Microsoft Knowledge Base:
Q120802 Office: How to Add/Remove a Single Office Program or Component
For additional information, please see the following article in the
Microsoft Knowledge Base:
Q160988 WD97: How to Create Ordinal (Legal) Dates in Form Fields
Q134910 WD: How to Set a Default Date Field Format in Word
For additional information about this situation in earlier versions of
Word, please see the following article in the Microsoft Knowledge Base:
Q59019 WD: Creating Custom Date Formats with Glossary or AutoMac
Additional query words:
Additional query words: word97 word8
Keywords : kbfield macword98
Version : MACINTOSH:98; WINDOWS:97
Platform : MACINTOSH WINDOWS
Issue type : kbhowto
|