Solved

COMException (0x800A141F): Word was unable to read this document. It may be corrupt

Posted on 2011-09-20
12
1,385 Views
Last Modified: 2015-08-27
Hi,

i'm trying to open a word template from a web page in my developer windows 7 visual studio 2010 enviroment everything works fine, but when i publish in the server i get this error:

COMException (0x800A141F): Word was unable to read this document. It may be corrupt

The line code is this one:

_doc = _app.Documents.Add(ref _templatename, ref missing, ref missing, ref missing);

Thanks
0
Comment
Question by:j_a_jimenez
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 6
  • 5
12 Comments
 
LVL 1

Author Comment

by:j_a_jimenez
ID: 36568050
.
0
 
LVL 17

Expert Comment

by:andrewssd3
ID: 36568065
It must be a problem with the template named in ref _templatename.  Can you start a newWord  document from it  by double clicking on it in the normal way in Windows Explorer?
0
 
LVL 1

Author Comment

by:j_a_jimenez
ID: 36568132
andrewssd3:

Yes from windows explorer is no problem, i even tried to recreate the template.
0
The Eight Noble Truths of Backup and Recovery

How can IT departments tackle the challenges of a Big Data world? This white paper provides a roadmap to success and helps companies ensure that all their data is safe and secure, no matter if it resides on-premise with physical or virtual machines or in the cloud.

 
LVL 17

Expert Comment

by:andrewssd3
ID: 36568167
What version of Word are you targeting, and what is the format of the template (.dot, .dotx, etc)?
0
 
LVL 1

Author Comment

by:j_a_jimenez
ID: 36568182
Word 2010, template is .dotx, Server Windows 2008 R2, IIS 7.5, .NET 4
0
 
LVL 17

Expert Comment

by:andrewssd3
ID: 36568243
Can you post the template?  All I can think of is to see if I can replicate the problem.
0
 
LVL 1

Author Comment

by:j_a_jimenez
ID: 36568266
Sure I'll post it, the text is in spanish is that a problem?
 ContratoVentaDIPSA.dotx ContratoVentaDIPSA.dotx
0
 
LVL 17

Expert Comment

by:andrewssd3
ID: 36568354
No, as you say, it seems to work fine for me and it's a perfectly valid 2010 template file.  I hate to admit defeat but I don't think I can help you - I can't see any other references to this sort of problem on the web.

The only other thing is, does something happen to the file during the publish process that causes it to be corrupt?
0
 
LVL 1

Accepted Solution

by:
j_a_jimenez earned 0 total points
ID: 36568366
No. The template was recreated from scratch in the server.
0
 
LVL 17

Expert Comment

by:andrewssd3
ID: 36568376
Sorry - I don't know what else to suggest
0
 
LVL 1

Author Closing Comment

by:j_a_jimenez
ID: 37805209
...
0
 

Expert Comment

by:KrisKul
ID: 40949964
I know this is an old Topic, but i have the same Problem when i try to open a template with a SSIS package.

When I start the package over the Integration Services  it works. When I create a SQL Server Job which executes the SSIS package I get the error message, that the file could be corrupt.

Any idea, why it behaves like this?
0

Featured Post

Enroll in June's Course of the Month

June’s Course of the Month is now available! Experts Exchange’s Premium Members, Team Accounts, and Qualified Experts have access to a complimentary course each month as part of their membership—an extra way to sharpen your skills and increase training.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This collection of functions covers all the normal rounding methods of just about any numeric value.
Deploying a Microsoft Access application in a Citrix environment is not difficult but takes a few steps. However, Citrix system people are often of little help, as they typically know next to nothing about Access. The script provided here will take …
The viewer will learn how to simulate a series of sales calls dependent on a single skill level and learn how to simulate a series of sales calls dependent on two skill levels. Simulating Independent Sales Calls: Enter .75 into cell C2 – “skill leve…
The viewer will learn how to create two correlated normally distributed random variables in Excel, use a normal distribution to simulate the return on different levels of investment in each of the two funds over a period of ten years, and, create a …

695 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question