Thanks for your explanation Jonathan.
I just found this article which has excellent Excel examples for what I want
to do with Word:
http://www.cpearson.com/excel/vbe.htm#ListModules
We want to have better programmatic control over these documents so I think
we'll just hire a temp to reset the macro security so I can manipulate the
documents with VBA from Access.
I guess I understand Microsoft's position and why "no access" would be the
default. But, I say it's time we take back the world from all the malicious
people and terrorists who have sprouted up in the past 20 years. I am sick
to death of being thwarted by security measures designed to deter the virus
writers. I am sick to death of taking my shoes off to go through airport
security and having to wait in long lines to have my personal belongings
searched by a complete stranger.
Thanks again
There are three programmatic approaches you can try, using a wrapper to
batch update all the templates in your folder (the security options must be
set to allow access to vba project in all cases): -
1) identify the procedure in the module, delete it, add the new procedure if
necessary
2) identify the module, delete the whole module, import the new version
(assumes identically-named modules are actually identical, otherwise you
would need to manually standardise all your modules to begin, which wouldn't
be a bad thing)
3) Copy the text of the template to a new, blank template & import the new
module. You would need to ensure the new template has been set up with the
right styles, autotext entries etc (this can all be done programmatically
using a "master" template - this is the approach I've been using to update
and standardise my work's 350+ templates).
Another thought strikes me, however: -
If you only want the print macro to run when the template or document is
accessed from Access, open Word or excel invisibly. Have the print macro in
word or excel check to see if the application is visible. If it isn't, then
Word has been opened the normal way, & you can tell the code not to run the
print macro. If it's invisible, you can tell the print macro to run.
Yes, you still have to update all the macros in the templates the first time
around, but you will no longer have to worry about the print macro running
inappropriately.
| Thanks for your explanation Jonathan.
|
[quoted text clipped - 62 lines]
| > there are in the procedure. other related properties and methods allow you
| > to change the code in the project.