Bonjour,
Sorry, I do not know where I was this morning, but I was not thinking
straight... See my comments in-line!
Dans son message, < Jean-Guy Marcil > écrivait :
In this message, < Jean-Guy Marcil > wrote:
|| Bonjour,
||
|| Dans son message, < Steve Franks > écrivait :
|| In this message, < Steve Franks > wrote:
||
|||| Thank you Jean - Guy, you are right they are actually documents, rather
than
|||| Word templates.
|||| For my purposes they are templates in the literal sense of the word
i.e.
|||| recipes for users to follow.
||||
|||| The problem appears to be that some of the documents have attached
templates
|||| that don't exist, or at least I don't have access to them. These are
exactly
|||| the ones I want to investigate, but Word substitutes Normal.dot as its
|||| response to ActiveDocument.AttachedTemplate.
|||| I can see them when I look for them, but programmatically how do I
obtain
|||| their names?
||
|| Of course, as soon as you open the document if Word does not find the
|| template, it attaches Normal.dot.
True, but the document still knows it "real" Template, as long as you do not
change the attached template in the Templates & Add-in dialog.
||
|| If you want to know what the template is before opening it, you have to
use
|| the Template built-in document property.
|| E.g:
|| MsgBox ActiveDocument.BuiltInDocumentProperties(wdPropertyTemplate)
If you test for the attached template, you will get Normal.dot, as you have
found out. But you can still use
MsgBox ActiveDocument.BuiltInDocumentProperties(wdPropertyTemplate)
after opening the document and the original template name will be displayed.
||
|| You have to read that property before opening the document.
|| See
||
http://support.microsoft.com/?scid=kb;en-us;Q224351
|| and
||
http://word.mvps.org/faqs/macrosvba/DSOFile.htm
These links may be of interest to you (for future reference), but are not
necessary in this case.
Sorry again.
--
Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
(e-mail address removed)
Word MVP site:
http://www.word.mvps.org