Consulting

Results 1 to 8 of 8

Thread: Automatically Saving..

  1. #1
    Site Admin
    Urban Myth
    VBAX Guru
    Joined
    May 2004
    Location
    Oregon, United States
    Posts
    4,940
    Location

    Automatically Saving..

    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?

  2. #2
    Site Admin
    Jedi Master
    VBAX Guru Jacob Hilderbrand's Avatar
    Joined
    Jun 2004
    Location
    Roseville, CA
    Posts
    3,712
    Location
    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.
    [VBA]
    Option Explicit
    Private Sub Document_New()
    Dim Doc As Document
    For Each Doc In Documents
    MsgBox Doc.Name
    Next
    End Sub
    [/VBA]

    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.

  3. #3
    VBAX Newbie
    Joined
    Jul 2004
    Location
    A little south of Tulsa, Oklahoma
    Posts
    3
    Location
    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

  4. #4
    VBAX Newbie
    Joined
    Jul 2004
    Location
    A little south of Tulsa, Oklahoma
    Posts
    3
    Location
    Okay, maybe I misunderstood the question, but I thought is was worth my time to try to share what I thought.
    SisterGoldenHair

  5. #5
    Site Admin
    Urban Myth
    VBAX Guru
    Joined
    May 2004
    Location
    Oregon, United States
    Posts
    4,940
    Location
    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.

  6. #6
    Site Admin
    Jedi Master
    VBAX Guru Jacob Hilderbrand's Avatar
    Joined
    Jun 2004
    Location
    Roseville, CA
    Posts
    3,712
    Location
    Here is an example of OnTime for you.

    [VBA]
    Sub Test()

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

    End Sub
    [/VBA]

  7. #7
    Site Admin
    Urban Myth
    VBAX Guru
    Joined
    May 2004
    Location
    Oregon, United States
    Posts
    4,940
    Location
    Ah, very cool Jake! Thanks for that! So I take the serial time to be in succession of hours, minutes, seconds?

  8. #8
    Site Admin
    Jedi Master
    VBAX Guru Jacob Hilderbrand's Avatar
    Joined
    Jun 2004
    Location
    Roseville, CA
    Posts
    3,712
    Location
    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)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •