How to delete the "Document Template" value.

K

Kenneth

Is there a way to detect if a given Word (doc) file has an attached
"Document template" which I mean under "Document template" section in
"Templates" pane (Tools--> Templates and Add-ins".

The condition is NOT using VBA macro (ActiveDocument.AttachedTemplate) or
automate a Word object. Reasons being:

I have an application running as a windows service on a Windows Advanced
server 2000. This is a VB.NET app that automate Word 2003 as COM object. The
app runs as "brappadmin" which is a domain account that is specially used by
my application (i.e. not a user account).

The problem: Some Word documents have attached template stored on shared
network drive. My app will freeze or got stuck wherever the account
"brappadmin" does not have access permission to the Word template. It will
work, however, if the path does not exist.

Any help is appreciated.

thanks.

Ken
 
S

Shauna Kelly

Hi Kenneth

Every document, by definition, has an attached template. You cannot
delete the "Document Template" value. Well, in the user interface you
can physically delete the contents of the text box and click OK, but all
that achieves is attaching normal.dot to the file.

The following may help explain how Word works, what's going on and
potential solutions:

What is the relationship between a Microsoft Word document and its
template?

http://www.ShaunaKelly.com/word/templaterelations/index.html



What happens when I attach a new template to my document? or How do I
copy content and settings from a template to a document?

http://www.ShaunaKelly.com/word/attachtemplate/index.html



http://support.microsoft.com/kb/830561



Hope this helps.



Shauna Kelly. Microsoft MVP.
http://www.shaunakelly.com/word
 
K

Kenneth

Shauna Kelly said:
Hi Kenneth

Every document, by definition, has an attached template. You cannot
delete the "Document Template" value. Well, in the user interface you
can physically delete the contents of the text box and click OK, but all
that achieves is attaching normal.dot to the file.

The following may help explain how Word works, what's going on and
potential solutions:

What is the relationship between a Microsoft Word document and its
template?

http://www.ShaunaKelly.com/word/templaterelations/index.html



What happens when I attach a new template to my document? or How do I
copy content and settings from a template to a document?

http://www.ShaunaKelly.com/word/attachtemplate/index.html



http://support.microsoft.com/kb/830561



Hope this helps.



Shauna Kelly. Microsoft MVP.
http://www.shaunakelly.com/word
 

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