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

Tip: Looking for answers? Try searching our database.

Howto query the template a document is based on?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
J. Steinblock - 28 Sep 2005 08:45 GMT
Hi,

is there a way to query the template a document is based on (normal.dot,  
letter.dot, custom.dot etc...) from a vba-addin-code?
Charles Kenyon - 28 Sep 2005 18:40 GMT
Yes. But I simply use a Template field in the document
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.
.

> Hi,
>
> is there a way to query the template a document is based on (normal.dot,
> letter.dot, custom.dot etc...) from a vba-addin-code?
J. Steinblock - 29 Sep 2005 06:50 GMT
Thanks for reply,

but this solution won´t work for me.
I need to execute a macro everytime somebody in our company creates a new  
document but not if he opens a self-made or global template-file.
If I select Insert -> Field there is a Field-Function { TEMPLATE  \*  
MERGEFORMAT } that returns normal.dot (or the template name). But I  
haven´t found a way to access this value from my macro, yet.

> Yes. But I simply use a Template field in the document
Joost - 29 Sep 2005 13:21 GMT
Try ActiveDocument.AttachedTemplate.FullName including the full path or
ActiveDocument.AttachedTemplate.FullName for the Template only.
Joost Spijker - 29 Sep 2005 13:24 GMT
Last one should be ActiveDocument.AttachedTemplate.Name.
J. Steinblock - 29 Sep 2005 15:52 GMT
Thanks a lot, Joost!

I searched for something like that in the View->localwindow, but in the  
Tree ActiveDocument isn´t something like AttachedTemplate. A litte bit  
undocumentated?

> ActiveDocument.AttachedTemplate.Name

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.