Solved

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

Posted on 2011-09-20
12
1,363 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
  • 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
Use Case: Protecting a Hybrid Cloud Infrastructure

Microsoft Azure is rapidly becoming the norm in dynamic IT environments. This document describes the challenges that organizations face when protecting data in a hybrid cloud IT environment and presents a use case to demonstrate how Acronis Backup protects all data.

 
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

Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

Question has a verified solution.

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

Preface: When I started this series, I used the term CommandBars because that is the Office Object class that it discusses. Unfortunately, when Microsoft introduced Office 2007, they replaced the standard Commandbar menus with "The Ribbon" and rem…
Article by: Leon
Software Metering within our group of companies has always been an afterthought until auditing of software and licensing became a pain point. Orchestrator and SCCM metering gave us the answer and it was an exciting process.
The viewer will learn how to create a normally distributed random variable in Excel, use a normal distribution to simulate the return on an investment over a period of years, Create a Monte Carlo simulation using a normal random variable, and calcul…
This Micro Tutorial well show you how to find and replace special characters in Microsoft Word. This is similar to carriage returns to convert columns of values from Microsoft Excel into comma separated lists.

830 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