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 / August 2006

Tip: Looking for answers? Try searching our database.

Word 2003: Add-Inn

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Peter Faulhaber - 24 Aug 2006 13:00 GMT
Hi All,

I have a document based on Normal. I attach the document to a new custom
template via Tools, Templates and Add-Ins.

Is it possible to run a automacro, from the new attached template, after I
attached the template?
Cindy M. - 25 Aug 2006 09:35 GMT
Hi =?Utf-8?B?UGV0ZXIgRmF1bGhhYmVy?=,

> I have a document based on Normal. I attach the document to a new custom
> template via Tools, Templates and Add-Ins.
>  
> Is it possible to run a automacro, from the new attached template, after I
> attached the template?

Automatically you mean, without you needing to call it? No. You should be
able to use a macro to do the attaching, then calling the macro, though.
Along these lines

Sub AttachAndRun()
   Dim path As String
   
   path = "C:\Documents and Settings\[user name]\My Documents\xyz.dot"
   
   ActiveDocument.AttachedTemplate = path
   Application.Run "'path'!Module1.AutoOpenX"
End Sub

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 17 2005)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question or
reply in the newsgroup and not by e-mail :-)

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.