<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Frost Nova &#187; xml</title>
	<atom:link href="http://www.frostnova.net/tag/xml/feed" rel="self" type="application/rss+xml" />
	<link>http://www.frostnova.net</link>
	<description></description>
	<lastBuildDate>Fri, 16 Jul 2010 12:33:26 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Recover Broken Word 2007 Documents by Hacking the XML</title>
		<link>http://www.frostnova.net/archives/recover-broken-word-2007-documents-xml-style.html</link>
		<comments>http://www.frostnova.net/archives/recover-broken-word-2007-documents-xml-style.html#comments</comments>
		<pubDate>Thu, 25 Jun 2009 09:04:18 +0000</pubDate>
		<dc:creator>Si</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[apps]]></category>
		<category><![CDATA[help]]></category>
		<category><![CDATA[microsoft]]></category>
		<category><![CDATA[office]]></category>
		<category><![CDATA[text]]></category>
		<category><![CDATA[word]]></category>
		<category><![CDATA[xml]]></category>

		<guid isPermaLink="false">http://www.frostnova.net/?p=734</guid>
		<description><![CDATA[I like Word 2007 but like all Microsoft products, it comes with the affliction of complication. Word (and the Office Open XML format) is so complicated that there are a zillion possible things that could go wrong. Chances are one &#8230; <a href="http://www.frostnova.net/archives/recover-broken-word-2007-documents-xml-style.html">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I like Word 2007 but like all Microsoft products, it comes with the affliction of complication. Word (and the Office Open XML format) is so complicated that there are a zillion possible things that could go wrong. Chances are one of them is going to happen at some point. The moral of the story is, observe the motto of &#8220;Save Early. Save Often.&#8221; and you might avoid such a catastrophe. But if you&#8217;re lazy like me and forget to back up, this might happen.</p>
<p>Word is being funny, you are messing around with equations that aren&#8217;t behaving right. You try to save and it won&#8217;t let you save for some reason. You think &#8220;Oh I&#8217;ll just restart to make Word all better again.&#8221; You restart and your effing document won&#8217;t open with an error something like:</p>
<blockquote><p>The Office Open XML file FileName.docx cannot be opened because there are problems with the contents.</p></blockquote>
<p>WTF!? This was your only copy of the document! OMG! After you have taken a vallium, do the following:</p>
<p>Click <strong>Details </strong>on the error dialog and note down the location of the error (e.g. /word/document.xml, Line: 2, Column: 65946).</p>
<p>Rename your faulty document to FileName.docx<strong>.zip</strong> and extract it into some folder.</p>
<p>Open up the XML file listed in the error message and locate the offending column. For this you might want to download <a href="http://xml-copy-editor.sourceforge.net/">XML Copy Editor</a> or any other editor that has the features we need. You can see the column number in the status bar.</p>
<p>The offending error will probably be an XML tag. In my case column 65946 was at the * below (* has been added)</p>
<pre>... &lt;/w:t&gt;&lt;/m:r&gt;&lt;m:ctrlPr*&gt;&lt;w:rPr&gt;&lt;w:rFonts w:ascii="Cambria Math" ...</pre>
<p>So the error is in the <code>&lt;m:ctrlPr&gt;</code> tag. Now you need to add a fake attribute to the tag called <code>a="aaaaa"</code> or something easily identifiable that won&#8217;t occur naturally in the Office XML. Your tag should look like this.</p>
<pre>&lt;m:ctrlPr a="aaaaa"&gt;</pre>
<p>By default, the XML is all on one line to save on space, but we need to fix that to delete this tag.</p>
<p>In XML Copy Editor, select <strong>Pretty print </strong>from the <strong>XML</strong> menu. Now search for &#8220;aaaaa&#8221; or whatever you called your fake attribute. You should now be able to visually see the entire tag.</p>
<pre>&lt;m:ctrlPr a="aaaaa"&gt;
  &lt;w:rPr&gt;
    &lt;w:rFonts w:ascii="Cambria Math" w:hAnsi="Cambria Math"/&gt;
    &lt;w:i/&gt;
    &lt;w:lang w:val="en-AU"/&gt;
  &lt;/w:rPr&gt;
&lt;/m:ctrlPr&gt;</pre>
<p>Now just delete the whole <code>&lt;m:ctrlPr&gt;</code> tag and save the document. You can leave it in Pretty Print, it will still be valid XML.</p>
<p>Re-ZIP the <em>contents</em> of the folder you extracted to and rename document back to FileName.docx.</p>
<p>Try to open in Office 2007. If it works, Hooray! If it doesn&#8217;t, and you get another error, repeat this process. Else retype your 10,000 word document!</p>
<hr />
<a href="http://www.frostnova.net/archives/recover-broken-word-2007-documents-xml-style.html">Permalink</a> |
Tags: <a href="http://www.frostnova.net/tag/apps" rel="tag">apps</a>, <a href="http://www.frostnova.net/tag/help" rel="tag">help</a>, <a href="http://www.frostnova.net/tag/microsoft" rel="tag">microsoft</a>, <a href="http://www.frostnova.net/tag/office" rel="tag">office</a>, <a href="http://www.frostnova.net/tag/text" rel="tag">text</a>, <a href="http://www.frostnova.net/tag/word" rel="tag">word</a>, <a href="http://www.frostnova.net/tag/xml" rel="tag">xml</a> |
<a href="http://www.frostnova.net/archives/recover-broken-word-2007-documents-xml-style.html#comments">One comment</a> 
<span style="float:right">RSS by <a href="http://planetozh.com/blog/my-projects/wordpress-plugin-better-feed-rss/" target="_blank">Better Feed</a></span>
]]></content:encoded>
			<wfw:commentRss>http://www.frostnova.net/archives/recover-broken-word-2007-documents-xml-style.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
