Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
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
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
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
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
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 | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Current Date shows in Saved Word Document instead of Desired origi | Microsoft Word Help | |||
Update auto not checked, but current date inserts on old document | Microsoft Word Help | |||
Jump to a bookmark automatically when opening a word document | Microsoft Word Help | |||
Inserting most recent quarter date automatically | Microsoft Word Help | |||
auto current date entry in your document | Microsoft Word Help |