Word for Windows Macro to Insert Specified DatesLast reviewed: July 30, 1997Article ID: Q71343 |
The information in this article applies to:
SUMMARYIn Word, you can use a macro to have the date inserted be a number of days before or after today's date.
More InformationAs an example, to insert a date that is seven days after today's date, you would insert the following in the macro editor depending on the platform used:
Word 6.0 for Windows NT
Sub MAINa$ = GetPrivateProfileString$("HKEY_CURRENT_USER\software\Microsoft\Word\6.0\Opt ions", "DateFormat", "") SetPrivateProfileString "HKEY_CURRENT_USER\software\Microsoft\Word\6.0\Options", "DateFormat", "MMMM dddd, yyyy", "" Insert Date$(Today() + 7) SetPrivateProfileString "HKEY_CURRENT_USER\software\Microsoft\Word\6.0\Options", "DateFormat", a$, "" End Sub Word 6.0 for Windows
Sub MAINa$ = GetPrivateProfileString$("Microsoft Word", "DateFormat", "Winword6.Ini") SetPrivateProfileString "Microsoft Word", "DateFormat", "MMMM d,yyyy", "Winword6.Ini" Insert Date$(Today() + 7) SetPrivateProfileString "Microsoft Word", "DateFormat", a$, "Winword6.Ini" End Sub Word 6.0 for Macintosh
Sub MAINa$ = GetPrivateProfileString$("Microsoft Word", "DateFormat", "Word Settings (6)") SetPrivateProfileString "Microsoft Word", "DateFormat", "MMMM d,yyyy", "Winword6.Ini" Insert Date$(Today() + 7) SetPrivateProfileString "Microsoft Word", "DateFormat", a$, "Word Settings (6)" End Sub |
KBCategory:
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |