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.



About Bahrudin Hrnjica

PhD in Mechanical Engineering, Microsoft MVP for Visual Studio and Development Technologies. Likes .NET, Math,Data Science, Evolutionary Algorithms, Machine Learning, Blogging.

Posted on 23/01/2014, in Microsoft Office, MIcrosoft Word, Windows, Windows 8 and tagged , , , , . Bookmark the permalink. 91 Comments.

  1. Hi

    I have the same problem

    But my XML Plugins comes with nothing

    Are you able to help?

  2. Just saying thanks, your solution has been truly helpful!!

  3. Thanks from me as well, really a life saver!

  4. Adolfo Sosa

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

  5. Great post – the Notepad ++ XML plugin is what helped me and I fixed the issue.

  6. great job! thank you for sharing!

  7. Thanks! This really worked for me!

  8. You just saved me from a day full of tears. Thank you, sweet person.

  9. i dont understand how to change from docx into zip file. can u explain more?

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


  11. That kind of thinking shows you’re on top of your game

  12. Thanks, Worked for me… This guy deserves a bottle of champaigne. :)

  13. Thank you, it work for me.

  14. Puno hvala CARE kralju!!!

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

  16. Many Thanks it’s work for me

  17. You are the best! Very well explained and solved! I.O.U big time!

  18. Can annyone do this for me, I don’t understand how to fix it ! Please ! here is my e-mail :

  19. thank you..
    it work..

  20. Thanks!!!! it’s work for me, you are my hero!

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


  22. Code:

    State-controlled road



  23. Excellent work my friend, you’re a wizard :) Thank you!

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

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

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

  26. Excellent technique! Thanks for the info.

  27. Thank you!

  28. Many thanks! That fixed my problem too.

  29. Thanks mate, you saved my thesis!

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

  31. Thank you very much!!! Your tip was verrrrrrrrrrry turly helpful!!!!!

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

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

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

      • Mate, your “translation” was very helpful too.

      • Brada Pach

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

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

  36. Thank you! Thank you! Thank you! :D

  37. Excellent post! Thank you very much for taking the time to explain this! I was able to fix my files thanks to your tutorial.

  38. Karim Ismail

    wow this really worked. Thanks so much!!

  39. dude, you’re the best <3

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

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

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

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

  44. Angel de la Mora

    Thanks a lot

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

  46. Nelida Payton

    Hi easterbloom1! my assistant located a sample a form example here

  47. SAVED MY LIFE !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

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

  49. My word said :
    Xml parsing error
    Location: Line 0, Column 0

    Please help me

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

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

  52. You are a genius man!! You save my life!! :)

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

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


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

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

  57. Thank you very much Bahrudin !!
    Excellent Post

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

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

  60. Hey guys, i can’t fix it, there are so many trouble when i fix it line to line, so anyone could help me , i could help you so much Email:

  61. THANKS A LOT !

  62. This saved my sister’s thesis and ended a whole lot of tears! Much thanks :)

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

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

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

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

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

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

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

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 )

Twitter picture

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

Facebook photo

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

Google+ photo

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

Connecting to %s