Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Countdown Timer in MS Word!!

Status
Not open for further replies.

EliseFreedman

Programmer
Dec 6, 2002
470
GB
Hi there

Does anyone know if it is possible to include a countdown timer in a microsoft Word Document. I am producing a newsletter and I would like to include a timer along the lines of

x days, y hours, z minutes, a seconds till t event!!

Ive seen a similar thing to this in a javacript script for the web but I was wanting to use it in a microsoft word document. Any ideas?
 




Hi,

Yes, it is possible in ANY Office application using VBA.

Please post your question in Forum707.

Skip,

[glasses] When a diminutive clarvoyant had disappeared from detention, headlines read...
Small Medium at Large[tongue]
 
Hi,

if you do not want to use code you could use a set of fields and bookmarks. But: this is only a work-around as these fields only update when user presses F9 or the document is opened.

I did not test it extensively because a lot of research has to be done.* The principle is:

In Word afaik you cannot specify a date like in XL "Date(yr,mon,day)". You have to put the date into the document as simple text. Then you put a bookmark on it, which can be referenced to. So:

1) Put in Date of Event and bookmark it, e.g. bmDateEvent. The same with today's date: bmDateToday.

2) To extract the numeric value of a date you reference the bookmark with {ref bmDateEvent \# "0"}. The format switch \# converts the date into a value.

3) Now you can compute the difference in days with {={ref bmDateToday \# "0"} - {Ref bmDateEvent \# "0"}}.

4) Converting a time into a number would bring values between 0 and 1. Here it is easier to use the format switch \@ which brings you dates. E.g.: {Ref bmTimeEvent \@ "h"} shows the hour.

This works fine in Word97. But again: a lot of research has to be done. And without macros this is not updated continuously.

Markus.

* e.g. the value of May 9, 2007 is 60,000, the value of today is 112,016
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top