Results 1 to 2 of 2

Thread: Word was unable to read this document. It may be corrupt.Try one or more..

  1. #1

    Thread Starter
    Fanatic Member vuyiswamb's Avatar
    Join Date
    Jan 2007
    Location
    South Africa
    Posts
    829

    Word was unable to read this document. It may be corrupt.Try one or more..

    Good Day All

    i have a Windows Service written in .NET 4.5 and it is hosted on a Server where there is Office with the Version Microsoft Word 2013 15.0.4420.1017
    Microsoft Office Professional Plus 2013

    and my Windows Service does a Mail Merge and create Documents on fly.

    On my Development machine its working nicely i have Office
    Microsoft Word 2013 15.0.4719.1000
    Microsoft Office Professional Plus 2013

    i have given all the Permissions to the LocaLService user, the Document is not Corrupt , i can open it with no Problem and all the contents are in good shape.

    So on the Server i get this Error on my logs

    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.


    and LocalService is also Part of the Administrator Group for some desperacy reason to resolve this issue.

    The File Path of the Document and the Extension is Correct

    C:\LetterGenerator\Section78Notice.docx

    Thanks

  2. #2
    Superbly Moderated NeedSomeAnswers's Avatar
    Join Date
    Jun 2002
    Location
    Manchester uk
    Posts
    2,660

    Re: Word was unable to read this document. It may be corrupt.Try one or more..

    Its really bad practice to automate Word on the server,

    I have been telling anyone who will listen for a while now that the docx files are just zip files that contain various xml files that make up a word document.

    If you rename any .docx file to .Zip and open the zip you will see what i mean !!!

    It is pretty easy just to change the file extension, unpack the file and edit and merge into the XML document not to mention far far faster then automating word. On top of this you don't have any dependencies on Word itself.

    If you don't want to create your own methods to do this there is a free library already written by Microsoft to help you - OpenXML

    I would strongly recommend you use this method in particular in the server.
    Please Mark your Thread "Resolved", if the query is solved & Rate those who have helped you



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width