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 Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Dates in word ?

Status
Not open for further replies.

maxcrook

Programmer
Jan 25, 2001
210
GB
I have a document that has to be updated by manually typing in the date in the format dd/mm/yy (where dd = todays date -2) Is there anyway to get the document to automatically default to todays date - 2. Ie For the documents date today the date would be 18/02/02 (as its the 20th today)

Thanks

Max
 
Hello.

Using Microsoft Word 97, go to the "Insert" menu and select "Date and Time". Select the format you desire and then check the box that says, "Update automatically". Hopefully, this solves your problem.

Brian
 
That looks kinda what I wanted but it does have the option to display the date as 20/02/02 - 2days to give 18/02/02.

Is there any way that this can be done by querying a table with the dates in ?
 
This is probably a Mickey-Mouse fix, but how about setting the clock back on your machine by two days.

Or perhaps a better solution would be to insert a formula that calculated the date you need, much like a formula in Excel.
 
The date formula would be ideal. (I need a very similar result, like the other Max who started this thread.)

How can this be done to show the calculated date in a Word document? I have been trying a few different ways over the past few days but so far without success.

Any suggestions?

Max
(a different one)
 
I finally managed to do it with help from:

It worked to take my template, open the VB editor, choose the ThisDocument for my template, create a Document_Open(), and add the lines:

Selection.GoTo What:=wdGoToBookmark, Name:="PrevFriday"
Selection.InsertBefore Format((Date - 3), "MMMM d, yyyy")

(I plan to only use the document on Mondays so that is why the bookmark is named PrevFriday.)

I then saved the template and then a document based on the template.

Every time I open the document, the calculated date is inserted. I then either save the new instance of the document to a new name or discard the current instance. (If one saves the newly opened document, two dates will be at the bokkmarked location in the document the next time it is opened.)

Max
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top