View Single Post
  #2   Report Post  
Posted to microsoft.public.word.docmanagement
Steve Yandl Steve Yandl is offline
external usenet poster
 
Posts: 26
Default Is it possible to insert a future date automatically?

Here is something to get you started.

Open a new document, set the view to view headers and footers and where you
want the day and date in your header, insert a bookmark and name that
bookmark "dateHeader". Use Alt plus F8 and assign the subroutine below a
clever name. Close out VBE and save the document as a template (you may
want to make other cusomizations in the document body before you create the
template. When you create new documents from this template, running the
subroutine below will insert the next weekday's day and date into the header
(won't pay attention to skipping a holiday though, only Saturday and
Sunday).

___________________________

Sub PutNextWorkdayInHeader()

Dim dtmTemp As Date
Dim strDayDate As String

dtmTemp = Date + 1

Select Case Weekday(dtmTemp)
Case vbSaturday
dtmTemp = dtmTemp + 2
Case vbSunday
dtmTemp = dtmTemp + 1
End Select

strDayDate = FormatDateTime(dtmTemp, vbLongDate)

ActiveDocument.Bookmarks("dateHeader").Range.Inser tAfter strDayDate

End Sub

_________________________

Steve Yandl



"gladfelterk" wrote in message
...
I have a sign that I, print the night before, with daily meeting locations.
Is it possible to have the header update automatically with the next
workdays
day and date?