As a default, Word saves a backup file to the SAME folder as the
original. I want to automatically have it save to a BACKUP folder
instead. Here is my reason: I have .Mac which does an automatic daily
update. Since I use Word in many different folders, depending on what
I'm writing, if I wanted to save everything it would come to 300M, but
.Mac only gives 100M as backup space. I don't want to buy more space.
So I want to create a Backup file and have that only backup to .Mac
every night. I already have my other writing files saved onto CD and
DVD so I really don't need everything saved. Is there any way to
change the Word default so it will automatically save a backup to a
specially marked folder instead of the filder that the original file
is in. Thank you.
AFAIK, there's no built-in way to do this.
Here's one way. Put this in a global template. It will replace your
File/Save command.
The built-in Save command calls Save As the first time the document
is saved. Unfortunately, Word v.X has a bug that prevents using the
normal File/SaveAs dialog - VBA doesn't wait for the user to click
on Save or Cancel (it's actually an OSX dialog called by Word), so
you have a choice of entering the initial filename via a
inputbox/userform, or telling the user to use Save As the first time
the document is saved. For this purpose, I chose the latter route.
This means that the backup will not occur on the initial save.
Modify the Constants as desired for your path, and the
prefix/extension. As written, a file saved as either "hello" or
"hello.doc" will be saved in the backup folder as "Backup of
hello.doc". I limited the filename to 31 characters. Hopefully, some
day, that restriction will no longer be necessary.
'Put this in a global template to replace the built-in
'Save command
Public Sub FileSave()
'J.E. McGimpsey
Const BKUPPATH As String = _
"Macintosh HD:Users:je
ocuments:Backups:"
Const PRESTR As String = "Backup of "
Const XTNSN As String = ".doc"
Const MAXNAMELEN As Long = 31&
Dim svName As String
Dim bkName As String
Dim lenName As Long
Dim maxChars As Long
Dim oldSaveProperties As Boolean
Dim oldBackup As Boolean
With ActiveDocument
'Can't use wdDialogFileSaveAs in OS X due to bug!
'So have to punt on first save of document
If .Name = .FullName Then
MsgBox Prompt:= _
"Please save the document using ""Save As""", _
Buttons:=vbOKOnly, _
Title:="FileSave with Backup"
Else
'Already saved once
svName = .FullName
bkName = PRESTR & .Name
lenName = Len(bkName)
'Limit filename to MAXNAMELEN characters.
maxChars = MAXNAMELEN - Len(XTNSN)
'Strip any existing extension and add XTNSN
bkName = BKUPPATH & Left(Left(bkName, lenName + _
4 * (Mid(bkName, lenName - 3, 1) = ".")), _
maxChars) & XTNSN
'bypass SaveProperties and CreateBackup preferences
With Options
oldSaveProperties = .SavePropertiesPrompt
.SavePropertiesPrompt = False
oldBackup = .CreateBackup
.CreateBackup = False
End With
Application.DisplayAlerts = False
'Must save backup first, then document, or
'the backup will be the open file.
.SaveAs FileName:=bkName, AddToRecentFiles:=False
.SaveAs FileName:=svName
Application.DisplayAlerts = True
'Restore user preferences
With Options
.SavePropertiesPrompt = oldSaveProperties
.CreateBackup = oldBackup
End With
End If
End With
End Sub
Note that this is pretty bare-bones - no error checking, no format
options, etc.