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 / February 2007

Tip: Looking for answers? Try searching our database.

AutoOpen macros and the startup folder

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
John - 10 Feb 2007 00:45 GMT
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.
Jay Freedman - 10 Feb 2007 03:58 GMT
You may be able to use the OnTime function to delay the call for a
couple of seconds. See
http://word.mvps.org/faqs/userforms/AutoExecUsertFm.htm for a similar
technique.

--
Regards,
Jay Freedman
Microsoft Word MVP        FAQ: http://word.mvps.org
Email cannot be acknowledged; please post all follow-ups to the
newsgroup so all may benefit.

>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
[quoted text clipped - 15 lines]
>
>Thank you.
Sergio - 12 Feb 2007 11:54 GMT
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.

> 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
[quoted text clipped - 15 lines]
>
> Thank you.
 
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.