change attached template

V

vin

Hi,

I am trying to change the attached template programmatically. The word help
says:

ActiveDocument.AttachedTemplate="C:\TheFile\theTemplate.dot"

but I keep getting a runtime error 5947

Please help

Thanks
vin
 
P

Perry

Nothing wrong with yr 'code'.
You can assign and de-assign templates back/forth.
Something else is bugging you...

You'll have to forward some more code for the group to investigate

Krgrds,
Perry
 
N

Nick Stebbing

Hi vin,

I think I've had this problem before. For me it seemed that word was
treating the document as a template (which cannot have a template attached to
it).

Have a look at the properties item in the file menu. In the General tab is
the document "type" listed as a template?

Nick S
 
V

vin

Thanks for your responses. I moved the code from ThisDocument into a separate
code module and it worked. So I am happy and baffled.

vin
 

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