wbk managament macro

M

Modemjunkie

Thanks to assistance in another group, I found the following macro,
which saves my wbks to two directories, allowing me to delete the
backups in my active directory and still have copies:

Sub SaveToTwoLocations()
Dim strFileA, strFileB, strFileC
ActiveDocument.Save
strFileA = ActiveDocument.Name
'Define backup path shown in next line below
strFileB = "h:\work\backups\" & strFileA
strFileC = ActiveDocument.FullName
ActiveDocument.SaveAs FileName:=strFileB
ActiveDocument.SaveAs FileName:=strFileC
End Sub


Now, I want to take it a step further and, once the second .wbk is
created in the backups allow the macro to delete the original .wbk in
the active directory all as part of the same macro -- in one click of
the save in two places button.

That way my active directories will contain only the latest version of
a document, but the backup directory will contain the previous version
of every file.

The people in the other groups suggest I cannot do this for some
reason, but I don't understand why not.

So if anyone has any suggestions for command I can add to the above
macro, your help will be appreciated.

len
(e-mail address removed)
 
A

aalaan

That looks like the macro I showed in another group but BEWARE. You should
never save direct to removable media. It produces all sorts of errors. So it
is best to close the document first and then COPY it under windows from the
fixed drive to the removable one. Of course this doesn't apply if they are
both fixed hard disks.
 
G

Graham Mayor

It was never suggested that you couldn't delete the backups - merely that if
you wanted them deleted then why create them in the first place; the backups
are always merely clutter - *until you actually need them!*

You also misunderstand the purpose of the macro. This macro doesn't save the
previous version in a different folder, it only saves the *same* current
version in a different location. For the previous version that is where the
wbk comes in.

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


<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 
M

Modemjunkie

Ah, I see. For some reason I thought duplicate wbks were going into
the second directory, which is what I want. At least that would enable
me to delete the wbks from the active directory but have access to
themv elsewhere.

I want the previous version saved in another directory but my working
directory to only contain the current version. So saving in two
directories does not solve my problem. It would probably demand a much
more complex script that would do an ordinary save, including creation
of a wbk of the previous document, then copy it into the wbk
directory and then delete the wbk from the active directory.

I do want the backups if they were out of the way.

I think if Word did not name the files Backup of *.*.wbk it would be
less of a problem but the addition of "Backup" changes the sort order
and gets confusing.

Thanks for your patience in trying to get this through my think head.

Leonard
 

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