Discussion Locked

Word 2000 Save/SaveAs in two locations

0 helpful
6 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

I would like to be able to change the function of the Save and Save As in Word to be able to save the same file to two locations at once. One location will always be the same (local machine), and the user will need to chose the other location (on aserver) according to his/her preferences, but normally to a directory in his/her user directory.

I know that this can be done, I've seen it, but I've not been able to get the method used for this function from the tech people at that company.
Does anyone have at least an idea of how to approach this task, if not the answer completely? Unfortunately, with all my other duties, Ia've not had much time to spend on this problem.

\\Steve//

6 replies

by dklippert

I'll paste the macro. To get the original, go to the lounge at WWW.Wopr.com
Click on Search and then choose the Word Forum
In the Search for box enter 127677
The Search Option should be Message #
(Thanks to Jefferson Scher)

Sub FileSave()
' Saves as usual then makes a shadow copy
' Requires a reference to the Microsoft Scripting Runtime
' If document has not changed, then do nothing
If ActiveDocument.Saved Then Exit Sub
' Save or, if doc has never been saved, pop SaveAs
If ActiveDocument.Path = vbNullString Then
If Dialogs(wdDialogFileSaveAs).Show = 0 Then
' User chose Cancel, get out now!
Exit Sub
End If
Else
ActiveDocument.Save
End If
' Copy saved file to shadow folder
' FileCopy does notwork on an open file, so...
Dim objFS As New FileSystemObject
If Not objFS.FolderExists("c:\MyShadow") Then
objFS.CreateFolder "c:\MyShadow"
End If
objFS.CopyFile ActiveDocument.FullName, "c:\MyShadow\" & ActiveDocument.Name, True
Set objFS = Nothing
End Sub

I'm sure many people will want to experiment with this. Please be careful that you don't forget to Save first in your macros that intercept these commands, or only the old copy will get backed up and you will be very unhappy.
If you wanted to back up "time stamped" copies of the file, you could change the latter half of the macro as follows:

' Copy saved file to shadow folder
' FileCopy does not work on an open file, so...
Dim objFS As New FileSystemObject, fileDoc As File, strFName As String
If Not objFS.FolderExists("c:\MyShadow") Then
objFS.CreateFolder "c:\MyShadow"
End If
Set fileDoc = objFS.GetFile(ActiveDocument.FullName)
strFName = Left(ActiveDocument.Name, InStrRev(ActiveDocument.Name, "."))& _
Format(fileDoc.DateLastModified, "yy-mm-dd.hhnnss") & _
Right(ActiveDocument.Name, Len(ActiveDocument.Name) - _
InStrRev(ActiveDocument.Name, ".") + 1)

by lynne's honey

As per usual, we have not yet had time to play with this, but it does look like it will do what we want it to do with some modifications.

by shanghai sam

I was involve in a business unit needs analysis session awhile back where something similar was brought up. I recall that the approach was thought to be through the use of a visual basic for application vba macro of either autoclose or autosave. The idea was to save to the default and test for existence in a backup location and if not there, then prompt for selection. Something like that.

It was not my area of involvement so I did not pursue the outcome.

This might be a way to approachyour solution.

This discussion is closed to new replies.