If you use Word 2007, 2010 or 2013, you may encounter a strange error when opening a DOCX file. Recently, I tried to open a DOCX file that I had created on Windows 10 using Office 2013 and received the following error message:
The name in the end tag of the element must match the type of element in the start tag.
Hmm, I have no idea what that means! After doing some research, I found out that this error related to the XML of which a DOCX file is composed. Normally, this error will not result in loss of your file or its contents, but a good idea to make a copy of the file before you start making changes.
If you end up messing up the original file, you can always try again using the backup file. Here's what the error message looks like if you use Office 2013:
You will also see some extra information like Location: Part: /word/document.xml, Line: 2, Column: xxxx . So what causes this error? Apparently, they are equations! Specifically, related to oMath tags when an equation anchored to the same paragraph as a text box or graphic object.
Fortunately, there is an easy way to correct this error. I will start with the simplest and move on to more technical solutions for those interested.
Microsoft has released a Fix-it download that will go ahead and repair the problematic Word file. Note that although this will temporarily fix the problem, it may recur if you edit the file again. Scroll down to read how you can prevent this error from happening again.
Manually edit XML
If you want to do this manually, you can open the DOCX file and edit the XML. However, I don't really recommend it because it's complicated and it could ruin things even more. There is a way to adjust the real Word document, which you can read below.
Basically, the entire Word file is actually a zipped archive of a group of XML files. To see these files, you need to rename the extension from DOCX to ZIP.
In Windows 8/10, open Explore and click on the View tab. On the right, you will see a box called File name extensions . Go ahead and check that. Now rename the DOCX file to ZIP and double click on it to open it.
Here you will see a couple of folders and an XML file. The main content of your Word document inside the folder word . Open it and you will see one called document.xml .
This is the main XML that contains the content of your real Word document. The others are just settings, styles, fonts, etc. Now opening this in Notepad will seem like a disaster, so you want to search for it oMath because this is the tag that causes problems. Basically, it should look like this:
If the first line somehow under or after lines two or three, then you will get this error. you must move it immediately above these lines in order to open the Word file.
Permanent correction for end of boot tag error
Hopefully, the Fix-it tool has solved the problem, but it may repeat itself if the underlying cause is not resolved permanently. To do this, all you need to do is update Office 2010 or Office 2013 Service Pack 1. The problem solved in the service packs, so if you have not installed them, go ahead and do it.
Once installed, the problem does not occur with new files or with files that have been manually corrected or repaired using the Fix-it tool. If, for some reason, you are unable to upgrade to SP 1, there is another solution that requires adjusting the grouping mode of the equation and text boxes in the Word document.
Once you recover the DOCX file using the tool or by manually editing the file, go ahead and open the panel Selection in the card Home . You can access it by first clicking on the button Select .
A sidebar pane will open listing all the different objects on the page. Go ahead and hit the button CTRL and select all the text boxes.
After selecting the text boxes, click the Group in button Drawing tools – Format – Arrange . right next to the Select button that I mentioned above.
This should group all the text boxes together. Now save your document and see if you can open it again without the error. This is a permanent solution, so even if you don't upgrade to Service Pack 1, the error should go away. It definitely beats editing XML files. If you have any questions, please let us know in the comments. To enjoy!