Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.docmanagement
Mike
 
Posts: n/a
Default Can Date Automatically Appear in Document Name

I would like to be able to modify my normal template such that when I save my
documents as "document name" the document is saved as "document name"
2005-12-25.doc

Thus all of my saved documents would have the date built into the name. Is
it possible to have this automatically done without having to type the date
every time I save a document?
--
Mike
  #2   Report Post  
Posted to microsoft.public.word.docmanagement
Graham Mayor
 
Posts: n/a
Default Can Date Automatically Appear in Document Name

What's the point of this? Whenever you save a document, the file is date &
time stamped anyway. Switch Explorer to 'details' view and save yourself a
lot of programming grief.

--

Graham Mayor - Word MVP

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


Mike wrote:
I would like to be able to modify my normal template such that when I
save my documents as "document name" the document is saved as
"document name" 2005-12-25.doc

Thus all of my saved documents would have the date built into the
name. Is it possible to have this automatically done without having
to type the date every time I save a document?



  #3   Report Post  
Posted to microsoft.public.word.docmanagement
Cindy M -WordMVP-
 
Posts: n/a
Default Can Date Automatically Appear in Document Name

Hi ?B?TWlrZQ==?=,

I would like to be able to modify my normal template such that when I save my
documents as "document name" the document is saved as "document name"
2005-12-25.doc

Thus all of my saved documents would have the date built into the name. Is
it possible to have this automatically done without having to type the date
every time I save a document?

It would certainly be possible. It would involve naming a macro FileSave, and
another FileSaveAs. If you want this to happen for all documents on your system,
create the procedures in your Normal.Dot template. For just certain documents,
create them in that template. Those macros could look like this

Sub FileSave()
Dim doc As Word.Document

Set doc = ActiveDocument
If doc.Saved = False And _
Left(doc.Name, Len("Document")) = "Document" Then
SaveFileWithDate
Else
doc.Save
End If
End Sub

Sub FileSaveAs()
SaveFileWithDate
End Sub

Your main macro, called by the other two, would need to display the Save As
dialog box, but not allow it to execute. Roughly, that code would look like
this:

Sub SaveFileWithDate()
Dim s As String

With Dialogs(wdDialogFileSaveAs)
If .Display 0 Then
s = .Name
s = Replace(s, ".doc", "")
ActiveDocument.SaveAs s & Format(Date, "yyyy-mm-dd") & ".doc"
End If
End With
End Sub

If you need more help with this, I suggest you follow up in a more appropriate
Word.VBA newsgroup.

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 8 2004)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question or reply
in the newsgroup and not by e-mail :-)

Reply
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Current Date shows in Saved Word Document instead of Desired origi timc Microsoft Word Help 3 December 5th 05 10:05 PM
Update auto not checked, but current date inserts on old document RNBRN Microsoft Word Help 10 August 26th 05 05:26 PM
Jump to a bookmark automatically when opening a word document Steve D Microsoft Word Help 1 June 15th 05 06:10 PM
Inserting most recent quarter date automatically PWH Microsoft Word Help 1 January 17th 05 08:50 PM
auto current date entry in your document SDecou Microsoft Word Help 1 December 30th 04 10:47 PM


All times are GMT +1. The time now is 10:28 AM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"