How to manually fix content error in Microsoft Word


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, 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:


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:


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++.


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:


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.



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

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

  2. 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


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

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

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

  6. 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. 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???

    • 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.

  8. 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

  9. 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?

  10. 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.

  11. 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

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

      Assuming that you have both “” 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 “”. Delete “document.xml” stored inside. Paste the new version that you just copied.
      -Rename “” 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 “”.
      -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 “”. Delete “document.xml” stored inside. Paste the new version that you just copied.
      -Rename “” to “Folder.docx”.

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

      • 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.

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

  12. 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!

  13. Changed the document name.docx file, 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!!!!!!!!!!!!!

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

  15. 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.

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

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

  18. Pingback: 10 godina pisanja bloga | Bahrudin Hrnjica Blog

  19. 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?

  20. 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?

  21. 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!

  22. 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.

    • 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.


    • Memory stick like any memory device can fail overnight (it happens to me with a USB key).

      Backup is the only viable solution. For important information, follow the 3-2-1 rule
      – 3 copies of data
      – 2 media types
      – 1 copy off site

      P.S. It’s too late for you but might help people reading this post later

  23. 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 ?

  24. 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

  25. 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!

  26. 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!

  27. 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.

  28. 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.

  29. 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?

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

  31. Still useful few years later. Thanks a lot for the detailed information.

    In my case the error was in line 0 column 0 of /word/header1.xml. The problem was not visible on NP++ even after XML pretty. To fix it I simply replace the whole file with a fresh one from a new document generated from the same template (.dotx).

  32. Thank you. This worked perfectly.

    As a note: it won’t work if you completely extract the document to a folder, edit, compress that folder as a zip, then rename it back. It only works if you edit the zip archive in place for some reason. That is, open the zipped folder, extract only the document.xml file, edit it, save it, then drag the edited file back into the compressed folder.

  33. Hi, I am not a person who has great knowledge about the applications or the other parts of computer. But I know how to use MS office suite. i followed the exact same steps as mentioned above and still not able to open the word file. could you please help me with it.

  34. Worked like a charm..well it took me a while to read, investigate and install plugin, but what a learning curve! After struggling for about an hour I discovered Ann’s comments – “Ann on 16/02/2016 at 10:27 said:
    The instructions weren’t very clear. It took me a whole hour trying out various methods before it worked.Assuming that you have both “” and “Folder” (unzipped) in your PC…(..) ”
    Thanks Ann! It really helped to do follow your step by step zip-ing and docx-ing :) !
    It also helped that I discovered not corrupted earlier version of Word document I was trying to fix and then opened its document.xml in Notepad++ for comparison.

  35. I get the same error, but it says “Line: 0 Column: 0” Then how can I fix it? Help me please :(

  36. Hi,

    It did not work for me BUT, the BEST AND SIMPLEST SOLUTION is to Install LibreOffice, open the Word file in it, and save it back. The resulting file will open without any problems in Word for Windows or Mac. The copy and formatting will be intact. The only things you might loose are some pictures if there were some in your file. You’ll simply have to re-insert them.


Leave a Reply

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

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

Facebook photo

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

Connecting to %s