Run-time error '5180'

P

Paresh Trivedi

I am getting this error for some of the word document in word 2000:
"Run-time error '5180'
Word cannot open this document template.
(c:\temp\my_template_name.dot)."
The document opens fine after I click on the error.

This is how I open the document in VB:
---------------------------------
Dim lword As New Word.Application
Dim lword_document As Word.Document

Set lword_document = lword.Documents.Open("C:\Documents and
Settings\triv\Local Settings\Temp\file42.tmp", False, _
False, False, "doc_password", "", False, "", "",
wdOpenFormatAuto)
lword.Visible = True
---------------------------------

my_template_name.dot does exist in C:\Documents and
Settings\triv\Local Settings\Temp directory. The same place where I am
opening my word document.
I don't know why word is looking for my_template_name.dot in c:\temp.
Also this does not happen with all the documents.
After the document opens I see 'Templates and Add-ins' has correct
location for the dot file (user temp folder).
Is ther anyway to suppress this error?
Thanks
 

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