Error when opening a Word 2007 or 2010 document “The name in the end tag of the element must match the element type in the start tag”


We’ve recently noticed an issue where documents are becoming corrupt after making edits and saving the file.  There have been multiple forum threads related to this particular issue and the purpose of this blog is to try and give you some ideas for how to correct the problem.

The one disclaimer worth mentioning is that this is not a 100% fix for all corrupt documents, nor will it fix all documents that give you the specific error message noted below.  The idea is to try and give you some options for getting your document back to a state where you can make edits/changes.

Problem Description:

Opening a Word document gives you an error “The file <filename> cannot be opened because there are problems with the contents. 

The name in the end tag of the element must match the element type in the start tag.  Location: Part: /word/document.xml, Line: 2, Column: 129414″

 

If you came to this blog from the FixIt KB article http://support.microsoft.com/kb/2528942, you can use the steps below to try and edit the document so that the issue does not keep re-occurring when you make more edits to the document and save the file.  After running the FixIt you should be able open the document in Word without getting an error message.   

The problem however, still remains in the structure of the document. Typically it’s somewhere in an equation or a textbox.  If you make any edit to the document that doesn’t correct the behavior and you save the document, you will end up with the document still giving you the error message.  It’s important to keep in mind that the FixIt solution won’t prevent the problem from re-occurring. It can only put the document into a state where Word will be able to open the document. 

Next, we get to the workarounds and if you didn’t get to this blog post from the KB article, you can go to the article referenced above and run the FixIt solution to correct the document.  The KB article also has more information about this particular issue.  Once you have the document in a state where you can open it in Word, you can then proceed to the workarounds to try and correct the document.

Possible Workarounds: 

  1. Grouping objects.  These steps are done with Word 2010 in mind because the Selection Pane was introduced making it easier to see all the objects on the page and if you are using Word 2007 or earlier, it will be a little bit more difficult to select and group each individual object. 
    1. To start with, after opening the fixed document you will want to turn on the Selection pane.  This can be found in the Home tab of the ribbon.  In the Editing group of the Home tab, click the Select dropdown and then click Selection Pane….
    2. This will open a task pane on the right side of the document and allow you to view the different objects on the currently active page.
    3. Hold CTRL and select each Text Box in the selection pane.
    4. Now we want to group all these objects together. Under Drawing Tools, on the Format tab, in the Arrange group, click Group, and then click Group.
    5. Once you have all objects grouped on each page, you can save the document with a new name.
  2. Save the document in the RTF file format.  This should work for Word 2007 and Word 2010.If the first workaround didn’t work, you can try saving the document as an RTF file.  This method seems to consistently work in the example documents I’ve seen the exhibit the problem behavior.  It’s not an ideal solution and the file sizes get quite large, but if you need to edit the file and can’t find any other way of correcting the document, this might be your only option.
    1. After you open the document in Word, click  File  and then click Save (for Word 2007 click the Office Button  and then click Save As)
    2. In the Save As dialog, click on the Save as type: dropdown and select Rich Text Format (*.rtf), then click Save.
      1. You could also save the document in the binary (.doc) format, but I’ve seen that the shapes tend to get moved around and shifted so they don’t line up quite right so it’s up to you if you want to use .doc or .rtf.
      2. Both can work, but rtf seems to be more consistent and have the least visual changes in the document.
  3. If you are running into problems where the steps above do not work, you can upload the file to an online share and send me the link.  I’m working on adjusting the FixIt solution so that it will fix the document and these manual steps will not be necessary, but until then you will have to rely on the KB article, this blog or some of the online forums for help getting the document fixed.

 

Lastly, there have been a lot of forum threads related to this particular problem and I would like to say a huge “Thank You!” to the MVP’s and everyone else who has been helping people get their documents fixed. 

Comments (44)

  1. Anonymous says:

    Hi Brandon De, I emailed via this blog about the possibility of getting a Word 2010 doc fixed for an end tag error. Any luck with that?

    Thanks

  2. Hi Mila,

    Can you send me an email using the "Email Blog Author" option above?  Once I have the file I can take a look at fixing the document.

    Brandon

  3. Anonymous says:

    Hi Brandon,

    I just emailed you via “Email Blog Author” option about this error my file is having. Could you please have look or let me know if it is possible to have it fixed?

    Du.

  4. Anonymous says:

    Thanks, Brandon. I look forward to the FixIt.

    Only the very dedicated and/or those with specialist software can locate column 500,000 (or 5,000,000 in the one I saw the other day) and then make sense of what they see. I will have to give this some thought 🙂

  5. Hi Tony,

    Hopefully we will have a KB article for the FixIt soon and it will explain what it does in xml terms, but it will not give the location of the error with any context as it relates to content in the document.  

    The initial error message mentions the column, so you could go to that column specifically in the document.xml file after the FixIt has corrected the document and look for a clue as to what part of the document has the problem.  I could add this as another workaround when we get the FixIt published and update the blog if it will be helpful.

    Brandon

  6. Hi AcBoyd,

    Unfortunately, I haven't seen anything come in that you sent.  Would it be possible try the "Email blog author" option again?

    Brandon

  7. Anonymous says:

    Hi Brandon,

    I just emailed you via “Email Blog Author” option about this error my file is having. Could you please have look or let me know if it is possible to have it fixed?

    Du.

  8. Hi Wan Peng,

    I sent the fixed document.  Let me know if you have anymore problems.

    Brandon

  9. You can click "Email Blog Author" for this post, which will send me an email and we'll discuss possibly sending the file.  Once I have the document, I can try fixing it.

    -Brandon

  10. You can try clicking "Email blog author" and it should get sent to me.  If that doesn't work, reply back here and I'll give you the direct email address.

  11. Hey Gabrielle,

    Are you getting this message when using the FixIt article KB2528942 or is this just in general that you are seeing this behavior?

    Brandon

  12. Click on the Email Blog Author link for this post and I'll send you an email back where you can attach the problem file.

    Brandon

  13. Click on the Email Blog Author button for this blog post and then you can attach the file to the message for me to take a look at it.

  14. Tony Jollans says:

    Thank you for posting this, Brandon.

    Can you tell us – in xml terms – what the Fixit will do, and whether it will identify the location of the error(s)? Because, if someone has a document with several textboxes and equations it would be beneficial to know which one(s) may need attention if the FixIt has not been a complete success.

  15. wan peng says:

    Hello, this is wan peng here. can you please email the document to my email address*address removed*

    thank you for your kinds

  16. Rhet de Guzman says:

    Brandon,

    Thanks for all the tips. I've tried most of the tips on the forums how to fix this type of issue but to no avail my file is still not fixed. I've tried running the FixIt as well as a Rebuilder tool. According to the rebuilder the problem in my document does not involve any Math problems. Please help! I can email you the file if you can take a look at it please. Thanks!

    My email:**address removed**

  17. Gabrielle says:

    Brandon,

    when i opened a document, it said The file could not be found or The directory is not valid. i couldnt find the problem or how to open the file . i tried to open a copy but it said , the file couldnt be found. PLEASE HELP    ! thank you <3 gabby

  18. alex says:

    Hi Gabrielle, could you fix my document?

  19. charmagne says:

    i also need help…i can't open my document, here is the link of my file: http://www.mediafire.com

    if someone managed to recover it, please email me at maimaicomputer@yahoo.com

    thanks in advance.

  20. Maura Vrabel says:

    I'm having the same problems as Rhet. I ran the Fixit tool for the same error message about mismatching endtags and it said that the problem was not with omath tags even though I have a ton of equations in my document. I can email you the document from coldfiress16@gmail.com

  21. Amy Boyd says:

    Hi Brandon,

    I just emailed a new request, via the Email blog author, with a link to download the file.

    Many thanks.

  22. milad says:

    Dear Brandon I don't know which part of my document.xml file has problem and i should fix it.

    may I have your Email?

  23. milad says:

    dear Brandon I want to send my file to you, I couldn't send it via "Email blog author" so I need yours.

  24. Pavel Tsvetkov says:

    I have a very urgent problem of the kind described above, but in Windows XP and Office 2007, and the Microsoft Fix it solution does not work for me as the executable would not run. Can you help? Where can I send you the file?

  25. Ng says:

    Hi Brandon,

    I post the file to you already.

    Please let me know the solution also.

    Thanks!

  26. Ng says:

    Thanks Brandon for fixing the file. It is perfect 🙂

  27. Marnie says:

    Please help! Last night I had a file corrupt on a huge project due in 48 hours – no math equations but a ton of text boxes. I tried running a fix but it said my error was not a math error and couldn't be fixed. My file is probably too big to email (around 20MB). Can you help me?

  28. NestaV says:

    I am also having a problem with this and have tried numerous softwares to recover my file. Can someone please take a look at it and try to help me? If anyone is willing to help me, please email me at    glitter crazy 123 at gmail  (without spaces) Thank you in advance!

  29. mathala Juliet gupta says:

    I tried all these  options, my file is still not opening what can I do?

  30. Hemant Sethi says:

    Hi Brandon!

    My lab report file has the same problem and I need to submit it ASAP.

    I am mailing it to you via the email blog author option.

    Thanks.

  31. Milan says:

    Hi, Brandon.

    The same problem happened to me. This is a huge document (a research) with a lot of graphics and linked images. Following the instructions found here, I opened the document.xml file and I would say that this might be a problem, but I do not know how to solve it : The element type "mc:Fallback" must be terminated by the matching end-tag "</mc:Fallback>". Could you, please, be able to help?

    Kindest regards,

    Mila

  32. Tom_sce says:

    Hi Brandon,

    I am currently experiencing the same issue as the previous comments.  I have a large document which has now decided not to open and provides the error: "The element type "mc:Fallback" must be terminated by the matching end-tag "</mc:Fallback>"  I was wondering if you could help me please, I have tried opening up the file in an XML editor but I cannot make sense of the language, it is too unfamiliar to me and with a large document I am having trouble understanding what I should be looking for.  Any help will be much appreciated.  I have also emailed you through the Email blog author option,

    Thanks, Tom

  33. DJinNM says:

    Same problem as Marni. I emailed you with a Google Drive link to the document with the problem. Hope you are able to help — I can't tell you how many hours I have spent on that document! Thanks.

  34. DJinNM says:

    Brandon, you are a godsend! I so much appreciate your help in quickly resolving this issue for me — and in the middle of a weekend, to boot! I had worked for hours on my document and although I had saved an earlier version, and also a PDF, it would have meant hours, probably days, of re-work to get back to the point where I encountered the error. Thanks very much for the first-class service!

  35. martina says:

    I had this problem, which made sense as I have many figures and an equation in my document. When I tried to use FixIt on this document, FixIt told me that "The damage to this document was not caused by the oMath or mc:Choices tag mismatch issue and cannot be fixed by this troubleshooter."  Any advice would be greatly appreciated.

  36. ali says:

    I have a problem opening my file as its says File Corrupted ” equal expected” word/StylesWithEffects.xml, line 2, Column 27127

    Is anything can be done or it can not recovered????
    Thanks

  37. gyl37 says:

    Hello Brandon, help me… I have same problem as Marni and the others, This is a huge document (a research) with a lot of graphics and equation, I tried running a fix but i couldn’t be fixed.

  38. gyl37 says:

    Hello Brandon, help me… I have same problem as Marni and the others, This is a huge document (a research) with a lot of graphics and equation, I tried running a fix but i couldn’t be fixed.

  39. gyl37 says:

    Hi Brandon, I just emailed you via "Email Blog Author" option about this error my file is having. Could you please have look and fix that
    thank you very much

  40. Dennis says:

    Dear,

    I am having the same troubles since two days.
    It solved when saving to word 2003, but I can not use all necessary functionality for my work.

    I tried solving the problem myself by extracting the XML code, but was not successful. Could you help me out?

    The problem seems to lie with an unclosed tag

    Kind regards,
    Dennis

  41. prabhu says:

    Hi, I have similar error in one of my thesis file, can you help me recover the document.

    my mail id id prabhumurugesan1990@outlook.com

  42. Joanne says:

    This did not work for me. it just said: Repair is not successful when I ran the fixit. Please help! this is urgent!!!!!!!!!
    Pls could I have your mail?

  43. Hey Joanne,

    Try downloading the following tool and see if that fixes the issue.

    https://wordcorruptdocchecker.codeplex.com/

    If not, then use the Email Author on this blog so we can communicate through email and I’ll try to fix the document as best I can.

    -Brandon

  44. Ashley says:

    I have a file that I’ve spent lots of time on that won’t open. I’ve tried everything! I tried to download the word corrupt code checker and my computer doesn’t have the necessary requirements. Can you please help?