Solved

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

Posted on 2011-09-20
12
1,376 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
Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

 
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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

As with any other System Center product, the installation for the Authoring Tool can be quite a pain sometimes. This article serves to help you avoid making these mistakes and hopefully save you a ton of time on troubleshooting :)  Step 1: Make sur…
Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
The viewer will learn how to make their project stand out over others by learning how to change colors and shapes, add spaces, change directions, and add bullets to their charts.
Learn how to make your own table of contents in Microsoft Word using paragraph styles and the automatic table of contents tool. We'll be using the paragraph styles in Word’s Home toolbar to help you create a table of contents. Type out your initial …

732 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