How to manually fix content error in Microsoft Word


Word2013_error1

Today while I was editing a document suddenly Word crashed and the document became unable to be opened. Every time I wanted to open it the same error was:

We’re sorry. We can’t open DocumentName.docx because we found a problem with its contents.
When I want to see Details the following message shows:
Unspecified error
Location: Part: /word/document.xml, Line 2, Column: 0.

Then I wanted to open auto-saved version of the document, the same error appeared. So I changed the DocumentName.docx  file in to DocumentName.zip, and extract the content, found document.xml file and opened it in Notepad++.

The picture below shows the content of the DocumentName.docx file, renamed in to zip and extracted:

Word2013_error2

If you didn’t know the word document with doc or docx extension is actually zip file, which you can extract.

I have opened the docuemnt.xml and try to find error in second line. This was mission impossible because all xml content is placed in this line. As you can see on the picture below:

Word2013_error3

To find which element cause the content problem we have to format XML content. I prefer using Notepad++ and XML Tool PlugIn. It can be installed through Plungins menu of Notepad++.

Word2013_error4

To format xml content choose option Pretty print (XML only – with line breaks) . After the content is formatted, back the Document.xml to zip, change the extension from zip to docx, and open the word document.

The same error appear, but when you choose for details you can read in which line is the error. Find the line in Notepad++ and delete whole tag element:

Word2013_error7

Copy document.xml back in to zip file, rename the extension and try to open. If you have another error, repeat the process again, otherwise your document is opened.

Word2013_error8

Advertisements

93 thoughts on “How to manually fix content error in Microsoft Word

  1. Will

    Hi

    I have the same problem

    But my XML Plugins comes with nothing

    Are you able to help?

    Reply
  2. Adolfo Sosa

    Thanks you so much! I had a 150 page word file with lots of equations and you saved my whole document! Thanks!

    Reply
      1. Kent

        Hey I dont understand when I change the .docx file to .zip cause it wont extract.

      2. Al Bara

        I can’t install the xml plugin i tried dragging into the note++ document but its not allowing me to do it!

  3. Jo

    please help. After I change the docx to zip, should I extract the both document.xml? one has path word\ and the other has path word\glossary\. or should I extract the whole content of the zip file into a folder.

    Also after Pretty print (XML only – with line breaks), should I save the document.xml file and replace the one in the original zip file.

    I’ve tried a number of times but when I get to open the file, no line number is given. just says file corrupted or something missing

    thanks

    Reply
    1. Javad

      same thing happened to me
      what should I do?
      a 150 page translated word file gone :(

      Reply
  4. Pingback: How To Fix Microsoft Word Error Problem With Contents in Windows

  5. Pingback: How to Fix Unspecified error Location: Part: /word/comments.xml, Line 2, Column: | Max in Words

  6. Mon

    Could you help me? My Notepad++ appeared “Error detected in content. Please correct them before applying pretty print” How to solve this?

    Reply
  7. Naresh

    Hi,
    I got the same problem but my error is related to a table tag where i am showing some data. If I remove the table code then the document gets open.The error specifically showing with tag in bottom of the code, there is start tag for this in the code.

    Could you help me in this?

    This is the code I commented in my document:

    State-controlled road

    7.3.1

    Reply
  8. sothoan

    Hi after I format the content XML, then achieve the folder to zip and to docx. when I open the file, it shows in the details : the file is corrupted. cannot be opened. How should I do???

    Reply
  9. Eve8

    Mine doesn’t show me the exact line, it says “line 2” and that line has all the content

    Reply
    1. Rob Simon

      Yes, it will show that unless you do the step above by setting the XML to Pretty Print using Notepad++. After you do that and change the file back to .docx and try to open it again in word, it will tell you the exact line instead of just line 2.

      Reply
  10. feld

    Hi,

    When I try to save the document.xml file after applying prettyprint, a popup box appeared, stating:

    XML Parsing error at line 29412:
    Premature end of data in tag document line 2

    I’m completely new to xml editing, so help would be appreciated!

    Thank you

    Reply
  11. JViernes

    Everything was working well. I thought. I deleted a row then went back and forth making changes to the .xml file. The errors continued so I continued to delete the problems. This ended with me removing the last two lines of the .xml file. So when I converted back to Word I ended with “Unexpected end of input. Location: Part:…..Line: xxxx, Column:0.

    Is there anything else I can do to correct that issue?

    Reply
    1. Bahrudin Hrnjica Post author

      Unfortunately this is only way I know to fix content error problem.

      But you probably have deleted bracket/s.

      Try to find missing bracket and close it.

      Reply
  12. Ram

    Is there any other workaround? If i remove that tag I can open the doc but the information residing in that tag is important and I can deleted them. Just FYI I am doing an automation project using OPEN XML.

    Reply
  13. Ziyad

    Hi,
    I’m following your instructions. However, after backing the docmune.xml to zip then changing it to docx, Word 2013 shows this error “Microsoft office cannot open this file because some parts are missing or invalid”. It is not showing a line number or anything else

    Reply
    1. Ann

      The instructions weren’t very clear. It took me a whole hour trying out various methods before it worked.

      Assuming that you have both “Folder.zip” and “Folder” (unzipped) in your PC.

      -In Notepad++, File > Save “document.xml”. It should replace the original file in “Folder” (unzipped).
      -Return to “Folder” (unzipped) and find “document.xml” that you just saved. Copy it.
      -Open (but not extract) the original “Folder.zip”. Delete “document.xml” stored inside. Paste the new version that you just copied.
      -Rename “Folder.zip” to “Folder.docx”.
      -Open “Folder.docx”. Click Show Details. The line error should appear. Write it on a piece of paper.
      -Rename “Folder.docx” to “Folder.zip”.
      -Return to “Folder” (unzipped) and find “document.xml” that you saved in the beginning.
      -In Notepad++, find the line that has the error.
      -Delete that line and anything else after that it codes for. For example:

      Let’s say your error was line 2205. On that line, you see . Scroll down a bit more until you see the first . Delete , , and everything in between. So basically, if you see , you need to delete up until Hopefully, that makes sense.

      -File > Save “document.xml”. It should replace the previously saved file in “Folder” (unzipped).
      -Return to “Folder” (unzipped) and find “document.xml” that you just saved. Copy it.
      -Open (but not extract) the original “Folder.zip”. Delete “document.xml” stored inside. Paste the new version that you just copied.
      -Rename “Folder.zip” to “Folder.docx”.

      VIOLA! Your file should be recovered! Since you deleted the lines, you might need to retype some missing information in Word.

      Reply
      1. Ann

        I guess it didn’t like the coding examples I wrote out. Imagine everything in the as having no spaces.

        Let’s say your error was line 2205. On that line, you see . Scroll down a bit more until you see the first . Delete , , and everything in between. So basically, if you see , you need to delete up until the first . Hopefully, that makes sense.

      2. Brada Pach

        Excelente después de varios intentos lo logre…su explicación fue de mucha ayuda

  14. Zoe

    Hello I am having major problems, the endtag was mismatched so made the word doc into a zip file and there seems to a problem with one of the XML files it says there is an unspecified error. Would anyone mind taking a look at my word document. I would be Extremely grateful, I don’t know what else to do!

    Reply
      1. Zoe

        Hi Bahrudin,

        Thank you for replying but unfortunately this has not worked either. The error code is 0x80004005. Do you have any other ideas?

  15. Matthews

    Changed the document name.docx file to.zip, and
    Extracted the content,
    Found document.xml file and opened it in Notepad++.
    Then in notepad chose option Pretty print (XML only – with line breaks).
    What should I do next? Please somebody help!!!!!!!!!!!!!

    Reply
  16. Matthews

    I’m getting this error: xml parsing error at line 32612. Extra content at the end of the document. What to do now?

    Reply
  17. ChickMeister

    what means deleting the whole tag element? I cant find any botton that is deleting and there is no response when clicking the delete button.

    Reply
    1. Bahrudin Hrnjica Post author

      Hi,
      each tag element begins < … > adns with </ … >

      Example:

      <configuration> – begin of the tag element

      </configuration> – end of the tag element

      Reply
  18. JerryDC

    Great guide! Saved the day of one of our researchers after google Docs had apparently corrupted his document… thank you so much!

    Reply
  19. easterbloom1

    Good discussion . I learned a lot from the specifics – Does someone know where my company can obtain a sample IRS W-9 copy to fill in ?

    Reply
  20. Duy

    My team mate has the same problem. I’ve followed your steps and … awesome, it works.
    Thank you very much !!!

    Reply
  21. Pingback: 10 godina pisanja bloga | Bahrudin Hrnjica Blog

  22. kwalton

    I’m another happy reader who would not have fixed the problem without this article. Are you happy for me to share a link with readers on a LinkedIn group to which I contribute?

    Reply
      1. ayyied

        after I delete the whole tag, the docx still failed to open, it said the doc invalid. help me

  23. Jake

    I am having the exact same issue – unfortunately, I am unable to open my file at all, be it by saving and extracting as a zip, uploading to Google Docs, using Notepad++… does anyone have any ideas?

    Reply
  24. Boekworm

    It’s much easier!!! Open the document with the error in Wordpad, save it again as *.docx and open the new document in Word. Problem solved!

    Reply
  25. Natascha Minges

    Hi there

    Last night I saved my thesis on my memory stick and went to bed. In the morning when I went to try open it again it no longer wanted to open. I am busy trying your method but when I try extract the file it gives me an “Error 0x80004005: Unspecified error” once it reached the document.xml file. What should I do? I have written so much and have to hand in in 2 weeks. Please please help me.

    Reply
    1. Bahrudin Hrnjica Post author

      Hi Natascha,

      I am sorry to hear you cannot open such document, which is very important to you.
      I have explained all I know in the above blog post.

      Also try to read all comments here, there are some alternative suggestions how you can open it.

      If you still cannot open this document, send it to me via mail, I will try to open it, but I cannot guarantee I will succeed.

      Regards

      Reply
  26. D

    well… it works you just need to follow instructions exactly and a little common sense

    Reply
  27. Babou

    Hello when I try to pretty print with line breaks a pop up window says : “Error detected in content. Please correct them before applying pretty print.”
    could you help ?

    Reply
  28. Gloria

    Changed the ext to .zip but when I try to unzip it, the ext .cpgz is added onto the end
    Try to unzip that and it changes back to .zip
    Please help! It’s Valentines Day and I’m stuck doing this stupid report

    Reply
  29. Heli

    Hey! I keep deleting the lines it tell me to delete, but seems like they never end. I’ve done for half an hour already. Could I see somewhere how many of them I have to delete?
    Thanks a lot in advance!

    Reply
  30. Leighton Gamanie

    THANK YOU SO MUCH!!!!!!!
    You just saved me hours of re-typing equations man. For anyone having trouble, when the author says to convert the document.xml file to a zip file, he means grouping all the extracted files together and THEN converting to a zip file. Then simply change the extension of the zip file to .docx and you should see what line the error is in!

    Once again, thank you so much for this help!

    Reply
  31. Esau

    Thank you, what can i say, finally some sense with this Microsoft stupid error, I’ve always thought this some kind of joke, like ‘Hey something fucked up, go and fix it by your own fixer’, but your post, forget about it, you are just the live saver for our little soul.

    Reply
  32. Leo

    After couple of hours of going through other solutions I found this article and it was a breakthrough!
    only have to add that in my file problem was not in the tag that Word was reporting, but in the previous one.

    Reply
  33. Ferdinand

    Hi.
    (1) I downloaded and installed the Notepad++ program. But under “Plugins” there are these items: Converter, DSpellCheck, MIMI Tools. Nothing else is there. :-(

    (2) How can I fix an “Xml parsing error: Row 2., Column 2407916” when I am not an XML programmer?

    Reply
  34. Jens

    just want to say thanks, your tip saved us hours of work on a CV that we thought was lost, thank you so much.

    Reply

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

w

Connecting to %s