Hi all,
Here is the problem. If you have a document that was created from a
template the attachedtemplate property shows the name of the template. If
that template is missing then the attachedtemplate property shows normal.dot
as its value. If you open templates and addins the default template is shown
with the full file path to the template whether it exists or not. Is there
any way in vba to access that full path for the template without using the
attachedtemplate property since if the template is missing then so is the
path. Arrrrgh hope this all makes sense.

Thanks in advance
john price
jwp@beco.com

Re: AttachedTemplate shows normal.dot by Jonathan

Jonathan
Tue Jan 06 16:06:53 CST 2004

Hi John,

Yes, you can find out the name of the attached before you open the file, by
querying it using a DLL called dsofile.dll.

Take a look here for an article and sample code with more details.

Getting access to the Document Properties of a Word file
http://www.mvps.org/word/FAQs/MacrosVBA/DSOFile.htm


--
Regards
Jonathan West - Word MVP
http://www.multilinker.com
Please reply to the newsgroup


"John Price" <jwp@beco.com> wrote in message
news:OJpo4jJ1DHA.3140@tk2msftngp13.phx.gbl...
> Hi all,
> Here is the problem. If you have a document that was created from a
> template the attachedtemplate property shows the name of the template. If
> that template is missing then the attachedtemplate property shows
normal.dot
> as its value. If you open templates and addins the default template is
shown
> with the full file path to the template whether it exists or not. Is there
> any way in vba to access that full path for the template without using the
> attachedtemplate property since if the template is missing then so is the
> path. Arrrrgh hope this all makes sense.
>
> Thanks in advance
> john price
> jwp@beco.com
>
>


Re: AttachedTemplate shows normal.dot by John

John
Wed Jan 07 16:38:49 CST 2004

Johnathan,
Thanks for the quick reply. I tried using the DSOfile properties and the
template name is returned but not the full path.
The problem we have is there are thousands of documents created with
templates that point to a server that no longer exists. When a user opens
one of these documents there is a considerable delay before word times out
trying to access the server where it thinks the documents are stored. So
when the path reads \\myserver\share\templates\sometemplate.dot there isa
huge delay. What I was hoping to do was to open all of the documents. Read
the first part of the template path to see if it was pointing to c: a mapped
drive or a UNC and then change all of the "BAD" documents back to
normal.dot. I am afraid of changing all of the documents because if a user
has created their own templates on local drives they would be killed.

Thanks again for the help.
john price
jwp@beco.com

"Jonathan West" <jwest@mvps.org> wrote in message
news:OSwU9TK1DHA.2700@TK2MSFTNGP11.phx.gbl...
> Hi John,
>
> Yes, you can find out the name of the attached before you open the file,
by
> querying it using a DLL called dsofile.dll.
>
> Take a look here for an article and sample code with more details.
>
> Getting access to the Document Properties of a Word file
> http://www.mvps.org/word/FAQs/MacrosVBA/DSOFile.htm
>
>
> --
> Regards
> Jonathan West - Word MVP
> http://www.multilinker.com
> Please reply to the newsgroup
>
>
> "John Price" <jwp@beco.com> wrote in message
> news:OJpo4jJ1DHA.3140@tk2msftngp13.phx.gbl...
> > Hi all,
> > Here is the problem. If you have a document that was created from a
> > template the attachedtemplate property shows the name of the template.
If
> > that template is missing then the attachedtemplate property shows
> normal.dot
> > as its value. If you open templates and addins the default template is
> shown
> > with the full file path to the template whether it exists or not. Is
there
> > any way in vba to access that full path for the template without using
the
> > attachedtemplate property since if the template is missing then so is
the
> > path. Arrrrgh hope this all makes sense.
> >
> > Thanks in advance
> > john price
> > jwp@beco.com
> >
> >
>