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 / December 2004

Tip: Looking for answers? Try searching our database.

Calling sub from ThisDocument

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Poseur - 03 Dec 2004 01:45 GMT
Two questions, really.
I've got my macros in "MyMacros.dot" startup template. But I
need some of them in my Normal.ThisDocument
Document_New/Open/Close routines.
Haven't been able to call them out of the MyMacros project with
any variation of syntax ([MyMacros.vbp].[Utils].DoSomething).
So, I've had to copy some of them over to a local module in
Normal which seems kind of silly and redundant.

Is that because you just can't call out of project from
ThisDocument or because I just don't know how to do it?

Signature

Poseur
"That's just kooky talk." --Kramer

Charles Kenyon - 06 Dec 2004 16:46 GMT
Have you tried Application.Run MacroName:="MyMacro"

This may have a problem if used when Word is first opened because your new
document module may try to run before your Add-In is loaded.
Signature


Charles Kenyon

Word New User FAQ & Web Directory: http://addbalance.com/word

Intermediate User's Guide to Microsoft Word (supplemented version of
Microsoft's Legal Users' Guide) http://addbalance.com/usersguide

See also the MVP FAQ: http://www.mvps.org/word which is awesome!
--------- --------- --------- --------- --------- ---------
This message is posted to a newsgroup. Please post replies
and questions to the newsgroup so that others can learn
from my ignorance and your wisdom.

> Two questions, really.
> I've got my macros in "MyMacros.dot" startup template. But I
[quoted text clipped - 7 lines]
> Is that because you just can't call out of project from
> ThisDocument or because I just don't know how to do it?
Poseur - 08 Dec 2004 06:45 GMT
> Have you tried Application.Run MacroName:="MyMacro"
>
> This may have a problem if used when Word is first opened
> because your new document module may try to run before your
> Add-In is loaded.

Thanks. The suggestion from the previous responder (my
apologies, his post has disappeared off the server) finally sunk
in. The trick was to add a reference to Project "MyMacros.Dot"
to "Normal.dot" from within the IDE. The "MyMacros" add-in or
template loads on startup in Word but that was not sufficient
for the Normal template to refer to it's procedures.

Had me stumped for a while cause when I opened the "References"
dialog in VBA, Project "MyMacros" did not appear among the
uncheckeds. But I added it by browing to the .dot file and now
everything is good.

Signature

Poseur
"That's just kooky talk." --Kramer

 
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.