Origin and Attached template path, not always the same but..

L

Little Bear

Since user can have different path to their templats I sometimes would like
to find out witch templatepath the document was originally created with. The
only way i know i to find out the original path is to get the value from a
dialog wich can generate other types of problem. This will give me the
attached template path "ActiveDocument.AttachedTemplate.FullName". This will
give me the original template path
"Dialogs(wdDialogToolsTemplates).Template".

But how can i read the path of the original template without using Dialogs?
 
J

Jean-Guy Marcil

Little Bear was telling us:
Little Bear nous racontait que :
Since user can have different path to their templats I sometimes
would like to find out witch templatepath the document was originally
created with. The only way i know i to find out the original path is
to get the value from a dialog wich can generate other types of
problem. This will give me the attached template path
"ActiveDocument.AttachedTemplate.FullName". This will give me the
original template path "Dialogs(wdDialogToolsTemplates).Template".

But how can i read the path of the original template without using
Dialogs?

Have you tried :

ActiveDocument.BuiltInDocumentProperties(wdPropertyTemplate)

?

--
Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
(e-mail address removed)
Word MVP site: http://www.word.mvps.org
 
L

Little Bear

Yes but
ActiveDocument.BuiltInDocumentProperties(wdPropertyTemplate)
seems to give me the template name but not the path.
 
J

Jean-Guy Marcil

Little Bear was telling us:
Little Bear nous racontait que :
Yes but
ActiveDocument.BuiltInDocumentProperties(wdPropertyTemplate)
seems to give me the template name but not the path.

The path you are looking for maybe impossible to resolve if the document was
created on another machine, if the folder that contained the original
template has been deleted/renamed/moved, etc...

In case when the attached template path is unresolved, Word runs down a few
default folders (User templates, workgroups templates, default installation
template folder, current folder, etc.) to track down the missing template,
if it does not find it, it grabs Normal.dot.

You seem to be looking for a way to get the path of a template used to
create a document, but not attached to the document anymore, unfortunately,
I do not think you can do that.
--
Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
(e-mail address removed)
Word MVP site: http://www.word.mvps.org
 
L

Little Bear

The path you are looking for maybe impossible to resolve if the document was
created on another machine, if the folder that contained the original
template has been deleted/renamed/moved, etc...

In case when the attached template path is unresolved, Word runs down a few
default folders (User templates, workgroups templates, default installation
template folder, current folder, etc.) to track down the missing template,
if it does not find it, it grabs Normal.dot.

You seem to be looking for a way to get the path of a template used to
create a document, but not attached to the document anymore, unfortunately,
I do not think you can do that.
--
Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
(e-mail address removed)
Word MVP site: http://www.word.mvps.org

I´l give you the whole picture! When handling many different templates we
have choosen to put some of them in their own folder under the User Template
Path. The reason for that is to have different tabs for different kind of
templates when you create a new document. Earlier we had all templates on a
network share and using accessrights to decide wich templates a user could
see. Bu now we are trying this approached when the templates are in the
userprofile (on C:). Since every user have their own unique path and som
document wich are dependent on having the template attached are sometimes
beeing processed bye more than one user word can´t find the right template
when one user sends the dokument to another one, only if the temlpate is in a
default path. Today I can read the "original" template name and if that not
match the attached template then I can search through the default folders and
attached the right template againg. But there are some special cases when it
would be nice to get the original path (without using dialogs). But it´s not
a very big problem.

Thank you.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top