AutoOpen macros and the startup folder

J

John

In Word 2007, if I want to put all my macros in "AllMacros.dot" and run some
from Normal.dot's AutoOpen macro, how do I get around the fact that the
AllMacros.dot might not be open in time?

(I'm trying to stay compatible with word 2003 so I don't want to use ribbon
stuff. These macros add CommandBar's that I want available in all documents)

If I put "Application.Run "AllMacros.Module1.MyMacro"" in Normal.dot's
AutoOpen it works if I open word (to a blank document) and then open a
document.

But if I run "winword myfile.doc" from the command line, it fails because
Normal.dot's AutoOpen seems to be run BEFORE AllMacros.dot is loaded from the
startup folder. How can I handle this case?

(AutoOpen from AllMacros is not run for all documents so this isn't an
option).

Thank you.
 
S

Sergio

I was in a similar situation.

I don't remember the exact code, but I solved it this way:

in the AutoOpen macro I start checking the addins collection to see if my
dot is loaded. If it is not, I force the addins.add of my dot.

hope this helps.
 

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