Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I'm in need for saving a Word document as HTML. It has some background images, other images, texts, ... It opens correctly in Internet Explorer, but how can I save a word doc as HTML so that Firefox and other current browsers render it correctly?

All images are missing in the document. I looked through the generated html document, but the paths for the images appear to be correct.

Any idea?

Things like "Don't save docs as html" won't be helpful here.

Edit: To make myself clear, the normal "Save as HTML" doesn't cut it, the result is broken in any browser other than Internet Explorer.

Edit 2: What I'm using is Word 2010 and Firefox 4. I also tried rendering it in the latest Chrome version, which failed as well. I used different compatibility settings for saving as html, it did not help

share|improve this question
2  
Can you please provide a screenshot (or partial screenshot) showing us in what what way it fails? –  Majenko Apr 9 '11 at 13:02
    
Not of that particular document, I'll describe, if not enough I'll create something new. I have a word doc with background image over the entire page, I have other images at various locations, and I have formatted text on the page. The resulting HTML is a white background, no images, just the formatted text. –  private_meta Apr 9 '11 at 13:05
2  
using word for html is a horrible idea in general. I'm curious to how uploading it to google docs and using its html output function, or usign OOo/libreoffice to export would work tho –  Journeyman Geek Apr 9 '11 at 13:21
    
Can't help about the Word doc itself. Google Docs shows the image, but destroys the entire format even more than Word Export does. I didn't try OOo yet, don't have it installed right now –  private_meta Apr 9 '11 at 13:27
    
Just tested in Open Office (3.2.*). It looks ok in Open Office Writer, but breaks when viewed in a browser –  private_meta Apr 9 '11 at 13:53

6 Answers 6

I encountered the same issue. It seems that for some reasons Word does export regular HTML for some documents.

Usually Word exports graphics with two codes: a special one for rendering in IE, and regular HTML for the other browsers.

The code looks like below (I removed a lot of the code for readability)

<p ...><span ...><!--[if gte vml 1]><v:shapetype...>
 [code for IE]
</v:shapetype>
<v:shape id="Picture_x0020_2" ... alt="...png" ...>
 <v:imagedata src="...docx_files/image001.png".../>
</v:shape><![endif]-->
<![if !vml]><img width=169 height=119
src="..."... ><![endif]></span></p>

Notice the conditional?

<!--[if gte vml 1]> IE Code <![endif]--> <![if !vml]> Non IE HTML <![endif]>

For some documents I see that Word stops being bilingual and exports only the IE part.

I do not have the solution for these cases yet. Still investigating

share|improve this answer

I have a hack that involves modifying HTML code directly. I am using MS-Office 2007 and FF 10.0.4.

The trick is to remove the <v:imagedata src = ...> crud that Word generates when you save a file into HTML and replace that with the standard <img src = ...>. The former (imagedata ...) can only be rendered by IE while the latter is standard and can be handled by all browsers.

Example:

Remove the following -

<span style='mso-no-proof:yes'><v:shape id="Picture_x0020_2" o:spid="_x0000_i1026"
 type="#_x0000_t75" style='width:282.75pt;height:207.75pt;visibility:visible;
 mso-wrap-style:square'>
 <v:imagedata src="dcsl_overview_files/image006.png" o:title=""/>
</v:shape> </span>

With:

<img src="dcsl_overview_files/image006.png" alt="overview figure">
share|improve this answer

When using Word Save As Web Page(htm html), just prior to clicking Save, notice the "Tools" drop down to the left of the Save button. Go into this drop down, click the Web Options. In the options box that comes up, UNCHECK the box labeled "Rely on VML..." This worked great for me. Good luck.

share|improve this answer
    
What version of Word did you have? I've looked at 2003 up and they all seem to have "Rely on VML..." unchecked by default. –  Stephen Jun 5 at 2:56

I've only tried a simple document, rendered in Chrome, so YMMV - but have you tried to save as Web Page, Filtered (available in my copy of Word 2010, and I assume in all versions).

This should strip out a lot of the worst stuff, but still, the output may not always be perfect, browser-neutral HTML.

share|improve this answer

Try save as Web Page, Filter to remove Office-specific tags. On Word 2007, this clean up all the ugly office tags and generate a clean html file.

share|improve this answer
up vote -1 down vote accepted

As apparently nothing else worked, it became one of these damn "IE only" solutions.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.