Save Word with current

L

lake

I have a Word checklist template that I open every day,
make my checklist changes and save it as a doc ... I would
like a macro that will prompt me to save he document with
the date eg checklist_2004-06-23.doc

Can anyone assist?
Thanks a million
 
G

Graham Mayor

The following macro will save the document with the filename required. Save
the document as a template and save the macro in that template. Each day
create a new document from the template which will automatically be saved
with the required filename. Change the save path as required.

Sub AutoNew()
Dim myDate, strFileA As String
myDate = Format(Date, "yyyy-mm-dd")

' Define target file path below.
strFileA = "D:\My Documents\Checklist_" & myDate

ActiveDocument.SaveAs FileName:=strFileA
End Sub

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP


<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 
G

Graham Mayor

The downside will occur if you use it twice on the same day. :(

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP


<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 
L

Lake

No worries.. to me this is the best thing since slice
bread. anychance of inserting the users name who is
creating the document on that particular day? eg %username%
_Checklist_" & myDate

Once again Thanks again Graham
 
G

Graham Mayor

Try:

Sub AutoNew()
Dim myDate, strFileA, strUser As String
myDate = Format(Date, "yyyy-mm-dd")
strUser = Application.UserName
' Define target file path below.
strFileA = "D:\My Documents\" & strUser & "_Checklist_" & myDate

ActiveDocument.SaveAs FileName:=strFileA
End Sub


--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP


<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top