Discussion:
Howto query the template a document is based on?
(too old to reply)
J. Steinblock
2005-09-28 07:45:37 UTC
Permalink
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
2005-09-28 17:40:18 UTC
Permalink
Yes. But I simply use a Template field in the document
--
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.
.
Post by J. Steinblock
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
2005-09-29 05:50:39 UTC
Permalink
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.


On Wed, 28 Sep 2005 12:40:18 -0500, Charles Kenyon
Post by Charles Kenyon
Yes. But I simply use a Template field in the document
Joost via OfficeKB.com
2005-09-29 12:22:02 UTC
Permalink
Try ActiveDocument.AttachedTemplate.FullName including the full path or
ActiveDocument.AttachedTemplate.FullName for the Template only.
--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.aspx/word-programming/200509/1
Joost Spijker via OfficeKB.com
2005-09-29 12:24:12 UTC
Permalink
Last one should be ActiveDocument.AttachedTemplate.Name.
--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.aspx/word-programming/200509/1
J. Steinblock
2005-09-29 14:52:57 UTC
Permalink
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?

On Thu, 29 Sep 2005 12:24:12 GMT, Joost Spijker via OfficeKB.com
Post by Joost Spijker via OfficeKB.com
ActiveDocument.AttachedTemplate.Name
Loading...