synchronizing to HD and flash drive

D

DP

I am running Word 2002 and am constantly bringing my files to work via a
flash drive. With all the back-and-forth I often am unsure if my flash drive
or HD file is the current.
I reviewed Graham Mayor's (MVP) reply on this issue but it was confusing to
me.
What I am looking for is a macro (or other) that will save the document I am
working to both my HD and flash drive (if inserted) when requested. Thanks
 
G

Graham Mayor

I don't know which reply of mine you are referring to as you have not quoted
it or replied to the thread, however there's a method on my web site for
copying to flash http://www.gmayor.com/automatically_backup.htm
This adds a date to the filename and saves backups to alternative folders

If Even = (Day(Now) Mod 2) - 1 Then
strFileB = "D:\My Documents\Test\Versions\Odd\" & Format$(Date, "MMM d
") _
& strFileA
Else
strFileB = "D:\My Documents\Test\Versions\Even\" & Format$(Date, "MMM d
") _
& strFileA
End If

If you don't want that complexity, remove the above lines which should give
you something like the following. I have added an input box to enable you to
enter the drive letter of the flash drive as this is likely to change with
the hardware you plug the drive into (you can change the default there from
H to whatever you prefer) . You will need the macro on both the PCs you work
on. I would urge you to always copy from the flash drive to the hard drive
before working on the document.

Sub SaveACopyToFlash()

Dim strFileA As String
Dim strFileB As String
Dim strFlash As String

strFlash = InputBox("Enter Flash Drive Letter", "Flash Drive", "H")

ActiveDocument.Save 'save the original document
strFileA = ActiveDocument.name 'Saved original document name
strFlash = strFlash & ":\" & strFileA 'Flash drive filename
ActiveDocument.Close 'Close the document
On Error GoTo oops 'Error handler for missing flash drive
FileCopy strFileA, strFlash 'Copy source to flash
Documents.Open strFileA
End

oops:
If Err.Number = 61 Then
MsgBox "Disc Full! The partial file created will be deleted",
vbExclamation
Kill strFlash 'Remove the partial file
Else
MsgBox "The flash drive is not available", vbExclamation
End If
Documents.Open strFileA
End Sub

http://www.gmayor.com/installing_macro.htm

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP


<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top