backups

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I want to backup my Word 2003 files in a different folder to the default document location. In tools>options>file locations this is no longer a possibility
 
I want to backup my Word 2003 files in a different folder to the default document
location. In tools>options>file locations this is no longer a possibility<<


Check out the thread I started called "Unique Backup Filename, Not" in this
newsgroup. What I wanted was to backup to a different filename than the Word
default when I saved my current file. The macro I ended up with could easily be
adapted to save all word files to one single different folder. Doing it to various
folders would take additional code, or a different macro for each backup folder
location.

What backs up anyfilename.doc to anyfilename.doc.baq in the same directory is:

Sub BackupAndSave()
Dim strFileA, strFileB
Dim fs As Scripting.FileSystemObject
Set fs = New Scripting.FileSystemObject
strFileA = ActiveDocument.FullName
strFileB = strFileA & ".baq"
fs.CopyFile strFileA, strFileB
ActiveDocument.Save
End Sub

Instead of adding ".baq" to strFileA to name strFileB, you'd have to change
strFileB, something like

strFileB = "C:\PathtoBackupDirectory\" & strFileA

and change: strFileA = ActiveDocument.FullName

to: strFileA = ActiveDocument.Name

because FullName returns the full path and file name of the Active Document.

Someone else can jump in if I got any of this wrong, or if there's anything
dangerous about this. Like Word's "Always Create Back Up Copy", it will of course
overwrite the last backup file with the most recent one.

I assigned my macro to Ctrl-S and to a toolbar button.

Andy
 
Back
Top