Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / November 2007

Tip: Looking for answers? Try searching our database.

Insert date/time stamp into "save as" filename?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Nowhere@nohow.net - 05 Nov 2007 06:38 GMT
I've created a master form that people will open, fill in, then save with a
different name. I want the new filename to always be the same text followed
by the date and time the form was saved. Can a macro be created to do this
without needing any user input?

For instance, user triggers the macro and that saves the form as "filename
November 4 2007 090023.doc" where filename is always the same, "November 4
2007" is the current date and "090023" represents the HHMMSS when the file
was saved. The user then clears the form, inputs new data, triggers the
macro and that saves it as "filename November 4 2007 090534".

The form will be used on laptops in vehicles and I'm trying to minimize the
amount of typing the driver has to do, as well as standardize the naming
convention.

Signature

"He has all the virtues I dislike and none of the vices I admire."
Sir Winston Churchill

Nowhere@nohow.net - 05 Nov 2007 06:41 GMT
Sorry, forgot to mention this is for Word 2003.

Signature

"He has all the virtues I dislike and none of the vices I admire."
Sir Winston Churchill

Graham Mayor - 05 Nov 2007 07:01 GMT
How about

Sub SaveForm()
Dim strDate As String
Dim strTime As String
Dim strFilename As String
strDate = Format((Date), "MMMM d yyyy")
strTime = Format((Time), " hhmmss")
strFilename = strDate & strTime & ".doc"
ActiveDocument.SaveAs strFilename
End Sub

Signature

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

My web site www.gmayor.com
Word MVP web site http://word.mvps.org
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>

> I've created a master form that people will open, fill in, then save
> with a different name. I want the new filename to always be the same
[quoted text clipped - 11 lines]
> minimize the amount of typing the driver has to do, as well as
> standardize the naming convention.
Nowhere@nohow.net - 06 Nov 2007 02:29 GMT
Outstanding, that works! Thank You.

Signature

"He has all the virtues I dislike and none of the vices I admire."
Sir Winston Churchill

Graham Mayor - 06 Nov 2007 07:24 GMT
You are welcome :)

Signature

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

My web site www.gmayor.com
Word MVP web site http://word.mvps.org
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>

> Outstanding, that works! Thank You.

Rate this thread:






 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.