I’ve been trying, unsuccessfully, to write a macro that automatically saves a document with a name that includes the date and time it was last saved, so I can keep track of multiple versions easily. E,g.: Memo re Macros 03-12-04 1301.doc. (The 1301 is 1:01 p.m. — since Windows doesn’t accept colons in filenames, that’s the best format I can think of.) I know about Word’s Document Property that returns the LastSavedDate, But that’s not enough for me to do this. I have two problems:
First is getting the date into the file name reliably, in the right place without scewing up the rest of the name. Right now, I’m envisioning just saving the file for the very first time, when I create it, with just the descriptive name. (In the example above, the descriptive name is Memo re Macros.) After that, every time I save it, I want Word to insert the right date and time after the descriptive name, adding the date/time after the descriptive name if there’s no date/time there yet, or replacing the date/ time that’s already there with the updated LastSavedTime.
Second, for some reason I’m having a problem getting Word to reliably get the last saved date. I know I have to have the macro save the document twice: the first time to set the last saved date variable properly, and the second to then use that updated date to put in the filename, but whatever I’m doing isn’t working consistently.
I can’t believe that there aren’t already a whole lot of macros floating around that do this, or that there isn’t a MUCH easier way of doing it than I’ve been envisioning.