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 / March 2005

Tip: Looking for answers? Try searching our database.

Template macros are not in doc created with template

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Markw911 - 30 Mar 2005 23:33 GMT
Hello.  I have a word template that has a macro in it.  The macro reads some
data in from an Outlook com addin.  Right now I am just popping a message box
to test it.  When I open the template and a new document (test1.doc) opens,
the macro is not available in it.  I want this macro to run automatically so
selecting it from the macros dialog is not an option.  Is there a way to
force the macros in a template to go with the new documents that get created
from this template?
Thanks, Mark
Jean-Guy Marcil - 31 Mar 2005 00:52 GMT
Markw911 was telling us:
Markw911 nous racontait que :

> Hello.  I have a word template that has a macro in it.  The macro
> reads some data in from an Outlook com addin.  Right now I am just
[quoted text clipped - 5 lines]
> template?
> Thanks, Mark

See the Document event in the ThisDocument module of your template.

Display the ThisDocument code pane, list the content of the dropdown list at
the top of the code window on the left, choose Document. Finally, choose an
event in the dropdown on the right.

Put your code inside the event sub that gets inserted when you select an
event. You want Document_New

Signature

Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
jmarcilREMOVE@CAPSsympatico.caTHISTOO
Word MVP site: http://www.word.mvps.org


Rate this thread:






 
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.