Yes I agree that is the way to proceed. Opening the word\document.xml file with Notepad++ and then opening the Replace function window, you can put each XML tag on its own line and get a line number for your error, instead of "line 2, column 0". Apparently
putting the tags each on their own line and then rezipping the document.xml file with its fellow XML subfiles, does no harm, but obviously helps a great deal pinpointing the problem.
However one should note, there is a trick to putting each tag on its own line in NotePad++...you have to be sure to move the radio button in the Search Mode section of the Replace Window from "Normal" to "Extended" and use "\n" to indicate a new line to
the program. See step number 5.
So here are the steps for recovering manually from Unspecified Error Line 2, Column 0. Credit for this algorithm should go to .
- Add a zip extension to your docx file or unzip it with your favorite zip program that doesn't care if the extension is docx and not zip.
2. Open the document.xml file found in the "word" folder of the zip in a text editor with line numbers. Try using the freeware NotePad++. Many expert users agree NotePad++ is the best software for
this kind of thing. I have turned on word-wrap from the View menu, so that why the text fills the screen instead of the normal case where line 2 runs off the page to the right almost ad infinitum I'm sure it seems...
3. Hit Ctl-A to select all the text.
4. Hit Ctl-H to open the Replace window.
5. Move the radio button in the lower left hand corner under "Search Method" "Normal" to "Extended". See the image below.
6. Replace "><;" (without the quotes of course), with ">\n<" (or ">\r\n<" as Daniel seems to prefer). This will put each tag on a new line. Don't forget to save the changes by clicking on the blue floppy disk icon in the upper left corner of NotePad++.
7. Now we move up one level in the folder structure and rezip the all the folders and files. Don't stuff the files and folders into a new folder. The [Content_Types].xml file and the _rels, customXml, docProps and word folder should all be in the root of your
rezipped file, not within another folder. Also add a docx extension. It's silly not to remove the zip while adding the docx extension, but I kept it to symbolize that the docx is an ordinary zip file too.
8. Now when we open the docx file in Word we get a line number location where the error is near.
9. Now we should go back to the document.xml file hopefully still in NotePad++. Your error is most likely due to something wrong with a set of <m:oMath> tags. My suggestion is to remove the whole equation from the starting <m:oMath> tag to the ending </m:oMath>.
If you know what you are doing and can see where Word is hanging up and correct that without removing the equation, all the better, but my piece of freeware which works on these files, just removes the whole equation, but it does so displaying what it has
removed so you can examine it.
10. After removing my offending XML form the document.xml and saving the file, move up one level to the root and rezip the folders and [Content_Types].xml file again and change the extension back to docx.
11. Thankfully, this strategy works for the file I was using as a demonstration. I blurred out the title page information to protect the user whose file I got from this forum as publicly shared.
12. Also as should be obvious, it's often a case of more than one set of bad tags. So if the first attempt fails, try again to remove the offending additional tags. One of the things I'm working on with my freeware is to build in automatic multiple removals
of bad tags.
13. Note, I'm aware of three other patterns of bad XML which will lead to "Unspecified error - Location: Part: /word/document.xml, Line: 2, Column: 0". They are:
- Something wrong inside a <w:tbl> and </w:tbl> tags. Removing the tags and everything in between, sometimes cures the problem.
- Something wrong inside of <w:fldChar w:fldCharType="begin"/> and <w:fldChar w:fldCharType="end"/>. These are tags that surround the Table of Contents. Removing the tags and the content in between allows these files to sometime open. That is a bit drastic
but it is what chrima reccommends here: http://help.wugnet.com/office/open-docx-file-content-error-ftopict1081932.html. It could come down to some
tags that shouldn't exist in the TOC. You might experiment to remove some odd looking tags within the TOC to see if you can save it although recreating it may be better. This blog post suggest an easy way to get rid of the TOC is to open the corrupt Word file
in Office Docs/Office365/Office Online, which have apparently lower standards as to what is corrupt in this regard, and apparently you then easily remove the TOC there and save it and then download it again for TOC recreation on your Desktop version of Word: http://problemswiththecontent.blogspot.com/2011/03/file-cannot-be-opened-because-there-are.html.
- Problems with Word files which have been edited with the EndNote add-in active, and providing automatic formatting, while concurrently tracking changes or maybe making comments in the Word document. - See:
http://community.thomsonreuters.com/t5/EndNote-General/Endnote-X1-quot-Unspecified-Error-quot-when-Word-2007-comments/td-p/476. The problem may be confined to Word 2007 and X1 and the X2 version of EndNote.
- There are probably other causes of unspecified errors.
My freeware is here:
http:/hostedfiles.wherehaveibeen.info/savvy_corrupt_DOCX_setup_2.0.4_without_adware.exe
I removed my adware offers for this version of the setup file. I'm working on an update of the program and will be posting here soon. Also my webpage of corrupt Word DOC and DOCX advice might be useful although it could use updating: http://directory.s2services.com/word_repair.htm.
The "S2SERVICES" coupon for free online recovery (usually $39) from Recoveronix' Online FIle Recovery, has been kindly extended by Emil Sildos Recoveronix' owner, until Nov. 1, 2014.
Finally, as Jeeped repeatedly points out, most of these issues are fixed for future problems by installing Service Packs and/or Hotfixes. The ones
I know about effecting these issues are below: