I need MS Word macro that shows date: today + 30 days. Is it hard to do?
P Petar Popara Jun 7, 2005 #1 I need MS Word macro that shows date: today + 30 days. Is it hard to do?
K Karl E. Peterson Jun 7, 2005 #3 Petar said: I need MS Word macro that shows date: today + 30 days. Is it hard to do? Click to expand... About as simple as they come... Public Function NowPlus30() As Date NowPlus30 = Now + 30 End Function If you don't want it *exactly* +30, but just want the date, you can modify it like: Public Function TodayPlus30() As Date TodayPlus30 = DateValue(Now + 30) End Function Later... Karl
Petar said: I need MS Word macro that shows date: today + 30 days. Is it hard to do? Click to expand... About as simple as they come... Public Function NowPlus30() As Date NowPlus30 = Now + 30 End Function If you don't want it *exactly* +30, but just want the date, you can modify it like: Public Function TodayPlus30() As Date TodayPlus30 = DateValue(Now + 30) End Function Later... Karl
G George Nicholson Jun 7, 2005 #4 Selection.TypeText Text:=Format(DateAdd("d", 30, Now()), "mmmm dd, yyyy") The DateAdd function adds 30 days to today The Format function handles how the resulting date/time value is displayed. HTH,
Selection.TypeText Text:=Format(DateAdd("d", 30, Now()), "mmmm dd, yyyy") The DateAdd function adds 30 days to today The Format function handles how the resulting date/time value is displayed. HTH,
P Petar Popara Jun 8, 2005 #5 Thank you all. Is there a way to put macro in the middle of Word text and then just to open Word doc, run macro once and it will enter new date in 5 locations in my doc?
Thank you all. Is there a way to put macro in the middle of Word text and then just to open Word doc, run macro once and it will enter new date in 5 locations in my doc?
J Jef Gorbach Jun 9, 2005 #6 havent looked, but suspect you could adapting the previous answers as an insert fieldcode in each location??
havent looked, but suspect you could adapting the previous answers as an insert fieldcode in each location??
P Petar Popara Jun 13, 2005 #7 What does it mean "insert fieldcode"? How can i do that? Where in the menu is it? Thank you very much.
What does it mean "insert fieldcode"? How can i do that? Where in the menu is it? Thank you very much.