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

About Bahrudin Hrnjica

PhD in Mechanical Engineering, Microsoft MVP for .NET. Likes .NET, Math, Mechanical Engineering, Evolutionary Algorithms, Blogging.

Posted on 23/01/2014, in Microsoft Office, MIcrosoft Word, Windows, Windows 8 and tagged , , , , . Bookmark the permalink. 71 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

    thanks

  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 : imad94mail@gmail.com

  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

    7.3.1

  22. Code:
    <!–

    State-controlled road

    7.3.1

    –>

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

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

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

  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 http://goo.gl/EvtNs4

  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?

  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:

WordPress.com Logo

You are commenting using your WordPress.com 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