Article ID: 121983
Article Last Modified on 8/16/2005
Sub MAIN
Defaultdate$=GetPrivateProfileString$(
"HKEY_CURRENT_USER\software\Micr soft\Word\7.0\Options","dateformat",
"")
SetPrivateProfileString(
"HKEY_CURRENT_USER\software\Microsoft\Word\7.0 Options", "dateformat",
"MMMM d,yyyy", "")
Days$ = InputBox$("Please enter the number of days from Today ")
NumDays = Val(days$)
serialEndDate = Now() + numDays
EndDate$ = Date$(serialEndDate)
Insert enddate$
SetPrivateProfileString
"HKEY_CURRENT_USER\software\Microsoft\Word\7.0\Options", "dateformat",
"defaultdate$", ""
End Sub
Sub MAIN
Defaultdate$ = GetPrivateProfileString$("microsoft word",
"dateformat","winword6.ini")
SetPrivateProfileString "microsoft word", "dateformat", "MMMM d,
yyyy","winword6.ini"
Days$ = InputBox$("Please enter the number of days from today")
NumDays = Val(days$)
SerialEndDate = Now() + numDays
EndDate$ = Date$(serialEndDate)
Insert enddate$
SetPrivateProfileString "microsoft word", "dateformat", defaultdate$,
"winword6.ini"
End Sub
Sub MAIN
Defaultdate$ = GetPrivateProfileString$
(HKEY_CURRENT_USER\software\Microsoft\Word\7.0\Options", "dateformat",
"")
SetPrivateProfileString
"HKEY_CURRENT_USER\software\Microsoft\Word\7.0\Options", "dateformat",
MMM d, yyyy", ""
NumDays = 30
SerialEndDate = Now() + NumDays
EndDate$ = Date$(serialEndDate)
Insert enddate$
SetPrivateProfileString
"HKEY_CURRENT_USER\software\Microsoft\Word\7.0\Options", "dateformat",
"defaultdate$", ""
End Sub
Sub MAIN
Defaultdate$ = GetPrivateProfileString$("microsoft word",
"dateformat","winword6.ini")
SetPrivateProfileString "microsoft word", "dateformat", "MMMM d,
yyyy", "winword6.ini"
NumDays = 30
SerialEndDate = Now() + numDays
EndDate$ = Date$(serialEndDate)
Insert enddate$
SetPrivateProfileString "microsoft word", "dateformat", defaultdate$,
"winword6.ini"
End Sub
Additional query words: 6.0 word6 7.0 word95 word7 winword
Keywords: kbmacroexample KB121983