Results 1 to 5 of 5
  1. #1
    New Lounger
    Join Date
    Feb 2002
    Location
    Des Moines, Iowa
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Automatic timed file backups (MS Word97/2000)

    Hello All,

    This is my first post to this forum, and I'm hoping that someone here might be able to provide me with some help. A few years ago, I wrote a series of WordBasic macros that would automatically save a Word document that was open and had focus, and at the same time, it would save a duplicate backup of the file in another folder (by default on the user's local C: drive). I also wrote a "timer on" and "timer off" macro, where one or the other would be "enabled" from the main macro via a popup dialog box (then either the timer on or timer off macro would be saved to an AutoExec macro so that the settings would carry over the next time Word was opened).

    So, for example, the user could turn on the "automatic backup" macro and set it to save every 10 minutes to the C:Wordbackup folder. The original Word file that was open (usually saved to a network drive) would first be saved every ten minutes, and then an exact duplicate would be saved to the C:Wordbackup folder (all taking place in the background). The user probably didn't even notice it occurring unless it was a very long document, at which point the hour glass might appear for a second or two. This macro was great because 1) it provided some security if the original file became corrupted, and 2) if our network crashed, then the user could simply go back and open up the last backup copy on the C: drive and continue working without having to start from scratch.

    Of course, all of our people now use Word 2000 (I still have Word97), and some of the old WordBasic macro commands no longer work in VBA (e.g., MacroCopy, ToolsMacro). Therefore, these four macros that used to work perfectly together, no longer work at all in the new version of Word. Has anyone ever run across any VBA script that will perform this function of saving a file and also saving a duplicate of the that file, and running on a timer? I've checked around on the web, but have found nothing. At present, I'm not proficient in VB, otherwise I'd try to write something myself. Any help, thoughts, or insight would be greatly appreciated!

    Gary.

  2. #2
    Gold Lounger
    Join Date
    Dec 2000
    Location
    Hollywood (sorta), California, USA
    Posts
    2,759
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Automatic timed file backups (MS Word97/2000)

    You do know that Word has both timed backup and file backup features built-in, right?

    From what you describe, your macros aren't needed unless you want to direct the full backup to a specific folder. But, by setting the "AutoRecover files" folder to the local disk, you can get what for all practical purposes is the same thing.
    Kevin <IMG SRC=http://www.wopr.com/w3tuserpics/Kevin_sig.gif alt="Keep the change, ya filthy animal...">
    <img src=/w3timages/blackline.gif width=33% height=2><img src=/w3timages/redline.gif width=33% height=2><img src=/w3timages/blackline.gif width=33% height=2>

  3. #3
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: Automatic timed file backups (MS Word97/2000)

    First, most of those old WordBasic methods should still work, but it doesn't hurt to update them. If security features prevent macro copying, well, perhaps the better solution is to change paradigms and distribute a global template rather than copying the macros into Normal.dot.

    Second, I disagree with Kevin on one feature: Word has no native option to save a backup copy on a local drive immediately after saving in the original path. (Unless I am really missing something big!)

    I believe we had a recent thread on this topic of local backups, but I'm not sure it led to any code. If the security issue is not the problem, can you post the critical portions of your macros here so we can take a crack and what the new methods are?

  4. #4
    Silver Lounger
    Join Date
    Jun 2001
    Location
    Morden, Surrey, United Kingdom
    Posts
    1,838
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Re: Automatic timed file backups (MS Word97/2000)

    Would saving a copy on a local drive immediately *before* saving on the network do? If so, this post is from the thread I think you're thinking of, jscher ...
    Beryl M


  5. #5
    New Lounger
    Join Date
    Feb 2002
    Location
    Des Moines, Iowa
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Automatic timed file backups (MS Word97/2000)

    Thanks everyone for your quick responses! I didn't think that Word's own backup feature would save the BAK file to a folder on a local drive necessarily, but always saves the backup file in the same folder as the original file (and that's the problem because our users usually want the backup on the local drive). And it wouldn't make any difference whether the network file or the local file was saved first, just so long as the original file has focus after the save takes place.

    I've attached a Word document that includes all of the code (as it is imported into Word97) from the four macros that worked in unison to make this automatic backup feature work in the old Word6. The "AUTOBACKUP" macro is the main macro that gets launched by the user and pops up a dialog box with the various settings. The "SAVEBACKUP" macro gets saved to a "SAVEBACKUPAMENDED" macro, and then that amended macro is the one that gets changed to indicate the backup folder location indicated by the user. The "TIMER_" and "TIMEROFF" macros turn on or off the timer, and either of these macros is also saved as an "AUTOEXEC" macro so that the backup settings set by the user in the original popup dialog box are still in place the next time the user launches Word. That way, the user doesn't have to run the AUTOBACKUP macro every time Word is started. The user can, for example, enable the backup to run every 15 minutes and save the backup file to the C:WordBackup folder, and then never worry about setting it again.

    When I run the AUTOBACKUP macro first, it appears from the error checking I've done, that the "WordBasic.MacroCopy" and the "WordBasic.ToolsMacro" commands are the reasons for the macro cancelling out. I haven't gotten any farther than that, but I'm sure there are probably other commands farther down in that macro, and also in the other three macros, that probably aren't valid in VBA.

    Since I'm not a programmer by any stretch of the imagination, I apologize in advance for the macro code in the attached file. I'm sure it's probably not very efficient or well-written, but it made sense to me at the time, and it worked fine, which is the main thing. We've had some network crashes in the past couple of months here, and some of the staff have lost much text in documents they were working on. That's why they would like to get this autobackup feature working again. If the budget crisis in the state of Iowa ever subsides, I'll have to get permission from our Director to take a VB course!!

    Thanks again.
    Gary.
    Attached Files Attached Files

Posting Permissions

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