asp.net-mvciisoffice-interopcomexceptionword-automation

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


Exception Details: System.Runtime.InteropServices.COMException: Word was unable to read this document. It may be corrupt. Try one or more of the following:

  • Open and Repair the file.
  • Open the file with the Text Recovery converter.] Microsoft.Office.Interop.Word.Documents.Add(Object& Template, Object& NewTemplate, Object& DocumentType, Object& Visible) +0

When running the solution through IIS on app server I'm getting this error. It's working fine in local. Tried both: changing Microsoft Word 97 - 2003 Document Authentication to none in DCOM Config and Interactive user permissions in security. And all required permissions are provided to the IIS user.


Solution

  • Adding IIS user as an admin on app server resolved the issue.

    Refer below URL to add a new user/admin on windows server. https://social.technet.microsoft.com/wiki/contents/articles/13436.windows-server-2012-how-to-add-an-account-to-a-local-administrator-group.aspx