PDA

View Full Version : Automatically Saving..



Zack Barresse
08-08-2004, 08:47 PM
Hello all,

I was recently prompted by a question from an acquaintence that led to this post. What would be the best way to have every word document I have save at a specified interval? As unfamiliar as I am with Word, this could be quite a venture for me. I was thinking it may have something to do with the normal.dot file. I could probably do this in Excel, but am not sure on Word.

Basically I'd like it to be like the current AutoSave, but actually save the file. So if I shut Word down without saving, I'm not going to lose umpteen hours worth of work, and not have to continually wonder when the last time I saved was.

Any thoughts?

Jacob Hilderbrand
08-08-2004, 09:12 PM
Well this doesn't really address your question, but what I do for Word and Excel is hit Ctrl + s whenever I get ready to take my hands off the keyboard. I got myself in the habbit now so I do it without really thinking.

Now to actually answer your question.

Option Explicit
Private Sub Document_New()
Dim Doc As Document
For Each Doc In Documents
MsgBox Doc.Name
Next
End Sub


Put it in Normal > ThisDocumnent

This will just state the names, but you can modify it as needed. Use Application.OnTime to set the interval and put the save code in a Module. Then call the macro in the Private Sub Document_New() section and make the module call itself with OnTime.

SisterGoldenHair
08-08-2004, 09:13 PM
Hi Zack,
I don't know a lot but I can tell you how to do this. In your Word Document, go to the Tools menu, then options, save tab, then check "Allow fast saves" and "Save AutoRecover info every _ minutes.(It allows you to specify from 1 minute upward). There are other options too, such as "always create backup copy". Hope this helps.

SisterGoldenHair
08-08-2004, 09:16 PM
Okay, maybe I misunderstood the question, but I thought is was worth my time to try to share what I thought.

Zack Barresse
08-09-2004, 07:17 AM
Thanks Goldie!

Although that's basically what I'm trying to do, except not use AutoSave. This was prompted by somebody who had lost all of their work by relying on AutoSave - which doesn't really work like a Save. I've really only programmed a couple of things in Word, and the statements are a little different. I'm going to try Jake's suggestion later today when I get a little more time. I need to look into the correct OnTime syntax to use, but I think it'll get me there. If/when I get the right code, I'll post it. :)

Jacob Hilderbrand
08-09-2004, 07:22 AM
Here is an example of OnTime for you.


Sub Test()

Application.OnTime Now + TimeSerial(1, 0, 0), "Test"
'Code Here

End Sub

Zack Barresse
08-09-2004, 07:31 AM
Ah, very cool Jake! Thanks for that! So I take the serial time to be in succession of hours, minutes, seconds?

Jacob Hilderbrand
08-09-2004, 07:33 AM
Yeah, you can also use TimeValue, then quote the time, but I like TimeSerial since it is a bit easier to use (imo)

TimeSerial(Hour, Minute, Second)