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.

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

Re: Insert date/time stamp into "save as" filename? by Nowhere

Nowhere
Sun Nov 04 22:41:01 PST 2007

Sorry, forgot to mention this is for Word 2003.

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

Re: Insert date/time stamp into "save as" filename? by Graham

Graham
Sun Nov 04 23:01:21 PST 2007

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


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

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

Nowhere@nohow.net wrote:
> 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.



Re: Insert date/time stamp into "save as" filename? by Nowhere

Nowhere
Mon Nov 05 18:29:59 PST 2007

Outstanding, that works! Thank You.

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

----== Posted via Newsfeeds.Com - Unlimited-Unrestricted-Secure Usenet News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+ Newsgroups
----= East and West-Coast Server Farms - Total Privacy via Encryption =----

Re: Insert date/time stamp into "save as" filename? by Graham

Graham
Mon Nov 05 23:24:36 PST 2007

You are welcome :)

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

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


Nowhere@nohow.net wrote:
> Outstanding, that works! Thank You.