Synchronize saving files into multiple locations?

Is there a way for me to save files in one location, and they are automatically saved in another location?

Basically we have a folder in which we keep backups, and we want to save a word document to our My Documents folder while at the same time the document in the backup folder is saved as well. Thanks in advance for your assistance.
WilliamK99Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

mullinsbcCommented:
I've never seen a multiple location save capability in any application, which is why I use a batch file to do something similar to what you want.

Essentially you create a .bat file in notepad with the backup (copy) commands you want.  I use XCOPY because it's a little more robust than regular COPY.  You can find all the switches to XCOPY by opening up a DOS screen and typing:

HELP XCOPY

Once you create your batch file, you can set it to automatically run at timed intervals by adding the batch file you created to the Windows Task Scheduler.

More info can be found here:

http://www.ahuka.com/backup/backup4.html



0
GrahamSkanRetiredCommented:
You can do this in VBA.

Put this code in the ThisDocument module of the Normal template.
Option Explicit
Const strBackUpFolder = "C:\MyBackups"
Const strAppName = "Documents"
Const strSecName = "For Backup"
 
Private Sub Document_Close()
    'call back up macro after close
    Application.OnTime DateAdd("s", 1, Now), "BackUpFiles"
End Sub
 
Private Sub BackUpFiles()
    Dim i As Integer
    Dim bClosed As Boolean
    Dim strForBackUp() As String
    Dim strParts() As String
    Dim strFile As String
    Dim v As Variant
    Dim doc As Document
    
    v = GetAllSettings(strAppName, strSecName)
    If Not IsEmpty(v) Then
        strForBackUp = v
        For i = 0 To UBound(strForBackUp)
            strParts = Split(strForBackUp(i, 1), "\")
            strFile = strParts(UBound(strParts))
            bClosed = True
            For Each doc In Documents
                bClosed = True
                If UCase$(doc.Name) = UCase$(strFile) Then
                    bClosed = False
                    Exit For 'not yet closed
                End If
            Next doc
            If bClosed Then
                FileCopy strForBackUp(i, 1), strBackUpFolder & "\" & strFile
                DeleteSetting strAppName, strSecName, strForBackUp(i, 0)
            End If
        Next i
    End If
End Sub
 
Sub FileSave()
    ActiveDocument.Save
    RememberForBackup
End Sub
 
Sub FileSaveAs()
Dim dlg As Dialog
Set dlg = Dialogs(wdDialogFileSaveAs)
    If dlg.Show = -1 Then
        RememberForBackup
    End If
End Sub
Sub RememberForBackup()
    Dim i As Integer
    Dim f As Integer
    Dim strForBackUp() As String
    Dim v As Variant
    
    v = GetAllSettings(strAppName, strSecName)
    If Not IsEmpty(v) Then
        strForBackUp = v
        For i = 0 To UBound(strForBackUp)
            If UCase$(ActiveDocument.Name) = UCase$(strForBackUp(i, 1)) Then
                Exit Sub 'already in list
            End If
            If strForBackUp(i, 0) > f Then
                f = strForBackUp(i, 0) + 1
            End If
        Next i
    End If
    SaveSetting strAppName, strSecName, f, ActiveDocument.Name
 
End Sub

Open in new window

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Office

From novice to tech pro — start learning today.