Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.docmanagement
gladfelterk gladfelterk is offline
external usenet poster
 
Posts: 1
Default 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   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?



  #3   Report Post  
Posted to microsoft.public.word.docmanagement
Graham Mayor Graham Mayor is offline
external usenet poster
 
Posts: 19,312
Default 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   Report Post  
Posted to microsoft.public.word.docmanagement
Joe M.[_2_] Joe M.[_2_] is offline
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.word.docmanagement
Graham Mayor Graham Mayor is offline
external usenet poster
 
Posts: 19,312
Default 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   Report Post  
Posted to microsoft.public.word.docmanagement
Graham Mayor Graham Mayor is offline
external usenet poster
 
Posts: 19,312
Default 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

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Automatically Generate Future Date in a Field ToniEPC Microsoft Word Help 2 May 19th 06 09:10 PM
How do i insert future date ina word document Codeed Microsoft Word Help 1 October 27th 05 06:50 AM
How to insert future date based on current date plus 14 days John Bakker Microsoft Word Help 1 January 31st 05 09:08 PM
insert a future date Tim Wallin Microsoft Word Help 10 December 5th 04 12:25 AM
insert a future date Tim Wallin Microsoft Word Help 3 December 4th 04 04:29 PM


All times are GMT +1. The time now is 11:53 AM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"