How do Auto date the file name when i save it?

D

DavidSwails

I would like to be able to add the current Date to the File name
automatically when I save it. For instance I run a report daily on status
changes and I want the date for the report the automatically be inserted in
the file name.
 
H

Herb Tyson [MVP]

You don't say which application you're talking about. A number of Office
programs could be coaxed into doing this using a VBA macro.
 
H

Herb Tyson [MVP]

At its simplest, in Word, the following creates a file name that includes a
date:

Sub DatedFileName()
FileNameToday$ = "File " + Date$ + ".doc"
ActiveDocument.SaveAs FileName:=FileNameToday$
End Sub


When I run this, it saves the current file as "File 05-08-2006.doc".

I'm not all that into Excel/Access, but I would imagine that the code would
be similar, if not identical.
 
D

DavidSwails

Thank you the help.

I wonder if that can be done when you open a window save dialog box?
 
H

Herb Tyson [MVP]

Expand the macro to incorporate the Save command. You might want to visit
one of the word.vba groups for additional help. There are similar groups for
Excel and Access.
 
Top