Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
Word: Is it possible to insert a future date automatically?
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? |
#2
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
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? |
#3
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
Is it possible to insert a future date automatically?
Yes, but it's complicated - see
http://www.gmayor.com/insert_a_date_...than_today.htm and the reference there to http://www.wopr.com/cgi-bin/w3t/show...?Number=249902 -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org gladfelterk wrote: 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? |
#4
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
Is it possible to insert a future date automatically?
I've tried the macro that you show on your site Graham but am (maybe) having
a little trouble with it. I can get it to function, but is it supposed to automatically update in a saved document? Example...I create a document and add "XX" number of days into the prompt. The macro adds the requested number of days. I close the document and if I re-open it in a month it still shows the original modified date rather than auto-updating to add "XX" number of days to TODAYS date. Is that the way its supposed to function? If so, is there a way around it? I need something that auto-updates and adds "XX" number of days as I re-open it month after month. Thanks....Joe "Graham Mayor" wrote: Yes, but it's complicated - see http://www.gmayor.com/insert_a_date_...than_today.htm and the reference there to http://www.wopr.com/cgi-bin/w3t/show...?Number=249902 -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org gladfelterk wrote: 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? |
#5
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
Is it possible to insert a future date automatically?
The macro inserts the date as text. If you want to have the date update and
show the date two days hence whenever you open the document, you need a field construction. You can get this from the linked document by fellow MVP 'macropod', which you can download from my web site and which is reproduced at http://www.gmayor.com/insert_a_date_...than_today.htm -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org Joe M. wrote: I've tried the macro that you show on your site Graham but am (maybe) having a little trouble with it. I can get it to function, but is it supposed to automatically update in a saved document? Example...I create a document and add "XX" number of days into the prompt. The macro adds the requested number of days. I close the document and if I re-open it in a month it still shows the original modified date rather than auto-updating to add "XX" number of days to TODAYS date. Is that the way its supposed to function? If so, is there a way around it? I need something that auto-updates and adds "XX" number of days as I re-open it month after month. Thanks....Joe "Graham Mayor" wrote: Yes, but it's complicated - see http://www.gmayor.com/insert_a_date_...than_today.htm and the reference there to http://www.wopr.com/cgi-bin/w3t/show...?Number=249902 -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org gladfelterk wrote: 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? |
#6
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
Is it possible to insert a future date automatically?
The field code shown on my web page shows the macropod's code modified to
use a CREATEDATE field, which will not update. The original code uses the DATE field which will. -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org Graham Mayor wrote: The macro inserts the date as text. If you want to have the date update and show the date two days hence whenever you open the document, you need a field construction. You can get this from the linked document by fellow MVP 'macropod', which you can download from my web site and which is reproduced at http://www.gmayor.com/insert_a_date_...than_today.htm Joe M. wrote: I've tried the macro that you show on your site Graham but am (maybe) having a little trouble with it. I can get it to function, but is it supposed to automatically update in a saved document? Example...I create a document and add "XX" number of days into the prompt. The macro adds the requested number of days. I close the document and if I re-open it in a month it still shows the original modified date rather than auto-updating to add "XX" number of days to TODAYS date. Is that the way its supposed to function? If so, is there a way around it? I need something that auto-updates and adds "XX" number of days as I re-open it month after month. Thanks....Joe "Graham Mayor" wrote: Yes, but it's complicated - see http://www.gmayor.com/insert_a_date_...than_today.htm and the reference there to http://www.wopr.com/cgi-bin/w3t/show...?Number=249902 -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org gladfelterk wrote: 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? |
Reply |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Automatically Generate Future Date in a Field | Microsoft Word Help | |||
How do i insert future date ina word document | Microsoft Word Help | |||
How to insert future date based on current date plus 14 days | Microsoft Word Help | |||
insert a future date | Microsoft Word Help | |||
insert a future date | Microsoft Word Help |