Overwrite a .dot file in the Startup Directory

D

Dave Lett

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
 
T

Tony Jollans

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
 

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