Thanks Shauna for the informative answer. In my office, I create the .dot
files for placement in the users' Word-Startup folders. I copy the .dot
files from my computer to the various workstations. Sometimes some of the
references get lost, and sometimes I find strange references with ~ prefixes
that have to be removed.
Bottom line (in light of your very helpful feedback), wouldnt't a good
solution be to password protect access to the Visual Basic Project (assuming
that that's possible; is it?)? Thus, a startup routine could automitically
check to see if the references are correct, and fix them if necessary.
Is this a harebrained idea?
thanks,
marc
Hi
No, it's not harebrained, but it's not practical, either<g>.
You can password protect the VB Project. Furthermore, you should do so.
If the code strikes a run-time error, and it's password protected, the
user gets an annoying, but not disastrous error message. If the code
strikes a run-time error, and it's not password protected, the user gets
a dialog box offering the user the opportunity to Debug. If the user
clicks that, they end up in your code, and very few people will know
where they are or how to get out of it. So yes, definitely
password-protect the project.
But password protection won't stop the references from breaking.
If you have references to other projects, the only practical way to
deploy your project is to use late binding.
If your project is very large, and late binding would make code
development and maintenance very difficult, then one way around it is to
have two .dot files. Put one in the Word Startup folder, and use only
late binding there. It should check whether it is able to create an
object of the required kind. If it passes the test, then that code can
load a second .dot (stored in a known location, but *not* in the Word
Startup folder). The second .dot file can have references to other
things, and it should work OK.
In practice, this will work if your references are to, eg, Excel or a
dll. It does not work so reliably if your references are to another .dot
file.
Hope this helps.
Shauna Kelly. Microsoft MVP.
http://www.shaunakelly.com/word
> Thanks Shauna for the informative answer. In my office, I create the
> .dot
[quoted text clipped - 62 lines]
>> >
>> > marceepoo