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
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