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

Save Word file as todays date

Status
Not open for further replies.

tgmoon

Technical User
Jan 31, 2001
54
GB
I've been looking all over but can't find anything, but is there an easy bit of code to save a word file named as todays date?

Many thanks

Thom
 


ActiveDocument.SaveAs "C:\SomeFolder\" & Format(Date, "yyyymmdd") & ".doc"

 
strDocName = format(date,"d-mmm-yy") & ".doc"
ActiveDocument.SaveAs FileName:=strDocName


_________________
Bob Rashkin
 





Hi,
Code:
ThisDocument.saveas format(date,"yyyymmdd") & ".doc"

Skip,
[sub]
[glasses] When a diminutive clarvoyant had disappeared from detention, headlines read...
[b]Small Medium at Large[/b][tongue][/sub]
 
Man, you three almost crowded out the server. I don't think I have ever see three with the same time stamp before. Interesting that you all assumed (as would I, 'tis true) that it was the active document being saved as.
Code:
Documents("The quick.doc").SaveAs _
   Format(Date, "yyyymmdd") & ".doc"
This would save the open (but NOT active) document "The quick.doc" with the date.

Or, if you are using a document object, it also does not have to be the active document.
Code:
ThatDoc.SaveAs _
   Format(Date, "yyyymmdd") & ".doc"
Note that the SavedAs file would automatically save the file to the folder path determined by the document object. You could of course, as JerryKlmns does, specify a folder.

faq219-2884

Gerry
My paintings and sculpture
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top