AttachedTemplate shows wrong values in Word 2007 COM-Addin

P

Peter Karlström

Hi

I'm developing a Word 2007 COM Addin in VB.NET Visual Studio 2008 with .NET
Framework 3.5 SP1.
One of the functions in the application is to ensure that the opened
document is attached to the correct template.
For that purpose I have made a function who takes car of this.

The problem occurs when a document is created with a template which does not
exist in the same folder in the client that openes the document.
The first thing I do when the document is opened is to check the attached
template with the command "var = <doc>.AttachedTemplate.Name".
When I do this, var gets the value "Normal". If I then check the template
manually with the Office button - Word-options - Templates, the value for
attached template is C:\TestTemplate.dotx. This file does not exist, but
where is this value located within the document? Apparently there is two
different ways of checking for the attached template, since I can get two
different values for the same document.

This causes a lot of problem for my COM Addin, specially since the command
<doc>.AttachedTemplate = "C:\Correct Folder\TestTemplate.dotx" doesn't seem
to change anything in the document.

Can anyone enlighten me on this?

Thanks in advance
 

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