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 / October 2006

Tip: Looking for answers? Try searching our database.

Overwrite a .dot file in the Startup Directory

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Dave Lett - 06 Oct 2006 19:12 GMT
Hi,

I'm trying to overwrite a .dot file in the Startup directory. I've tried
using

   FileCopy Source:=sSource, Destination:=sDestination
   WordBasic.CopyFileA FileName:=sSource, Directory:=sDestination

However, because the file is in the Startup directory and, therefore, in
use, I get a permission error. I even tried a Kill statement before copying
the file to the new destination.

I've read the article "Distributing macros to other users" at
http://word.mvps.org/faqs/macrosvba/DistributeMacros.htm, and I'm
investigating this with my IT department. Are there other solutions? Is it
possible to overwrite a .dot file in the Startup directory?

Thanks in advance,

Dave
Tony Jollans - 06 Oct 2006 20:03 GMT
Hi Dave,

Close it first. Then you should be able to do what you want. Then open it
again.

   AddIns(sDestination).Installed = False
   Kill sDestination
   FileCopy sSource, sDestination
   AddIns(sDestination).Installed = True

--
Enjoy,
Tony

> Hi,
>
[quoted text clipped - 16 lines]
>
> Dave
 
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.