Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / November 2006

Tip: Looking for answers? Try searching our database.

wbk managament macro

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Modemjunkie - 27 Nov 2006 22:23 GMT
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
Len@LGrossman.com
aalaan - 27 Nov 2006 22:35 GMT
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.

> Thanks to assistance in another group, I found the following macro,
> which saves my wbks to two directories, allowing me to delete the
[quoted text clipped - 28 lines]
> len
> Len@LGrossman.com
Graham Mayor - 28 Nov 2006 06:32 GMT
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.

Signature

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

My web site www.gmayor.com
Word MVP web site http://word.mvps.org
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>

> Thanks to assistance in another group, I found the following macro,
> which saves my wbks to two directories, allowing me to delete the
[quoted text clipped - 28 lines]
> len
> Len@LGrossman.com
Modemjunkie - 28 Nov 2006 16:25 GMT
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

> 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
[quoted text clipped - 45 lines]
> > len
> > Len@LGrossman.com
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.