Hmmm. If the requirement is for the date to be incremented automatically by
one, each time a document is created from the template, then a combination
of techniques would be required, with the last used date held in an ini
file.
The following is a minor variation of a macro I posted a while back, that
will type the date at a bookmark location called MenuDate, incremented by
one each time the macro is run. The count is stored in a text file saved in
the Word startup folder. A second macro allows for the count to be simply
reset.
The main macro could be run as an autonew macro from the menu template in
which the bookmark has been added at the appropriate location.
Sub AddMenuDateToBookmark()
Dim SettingsFile As String
Dim Order As String
SettingsFile = Options.DefaultFilePath(wdStartupPath) & "\Settings.ini"
Order = System.PrivateProfileString(SettingsFile, _
"MenuDate", "Order")
If Order = "" Then
Order = 0
End If
With Selection
.GoTo What:=wdGoToBookmark, _
name:="MenuDate"
.TypeText Text:=Format((Date + Order), "dddd d MMMM yyyy")
End With
Order = Order + 1
System.PrivateProfileString(SettingsFile, "MenuDate", _
"Order") = Order
End Sub
Sub ResetDateCount()
Dim SettingsFile As String
Dim Order As String
Dim sQuery As String
SettingsFile = Options.DefaultFilePath(wdStartupPath) & "\Settings.ini"
Order = System.PrivateProfileString(SettingsFile, _
"MenuDate", "Order")
sQuery = InputBox("Re-set date count?" & vbCr & _
"Default setting will re-use the last used date" & vbCr & _
"Enter '0' to return to today's date", "Reset", Order - 1)
If sQuery = "" Then Exit Sub
Order = sQuery
System.PrivateProfileString(SettingsFile, "MenuDate", _
"Order") = Order
End Sub
http://www.gmayor.com/installing_macro.htm
--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP
My web site
www.gmayor.com
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>