Tell me more ×
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
1  
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
1  
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
show 2 more comments

7 Answers

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

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
up vote -1 down vote accepted

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

share|improve this answer

See Link below for suitable answer if you are using Word 2010

http://answers.microsoft.com/en-us/office/forum/office_2010-word/word-2010-save-as-html-can-one-force-export-of/11aec36d-e987-4519-a37c-7ac5d0bff61e?msgId=444c9157-6092-4b13-ae8d-0b3fc83b7854

share|improve this answer
Welcome to Super User! Generally we like answers on the site to be able to stand on their own - Links are great, but if that link ever breaks the answer should have enough information to still be helpful. Please consider editing your answer to include more detail. See the FAQ for more info. – slm May 5 at 10:31

In Word, in the Save As dialog, in the Save as type: list, select Web Page (*.htm; *.html).

share|improve this answer
Not like I wouldn't have tried that. This way, it doesn't render properly in any browser other than Internet Explorer – private_meta Apr 9 '11 at 12:24
It works for me. You should be nicer if you want help. – systemovich Apr 9 '11 at 12:29
What version of Microsoft Word and Firefox did you try it with? Did you use images in there? – private_meta Apr 9 '11 at 12:34
Word 2007, Firefox 4. I inserted a GIF image and could see it in the browser. – systemovich Apr 9 '11 at 12:40
Doesn't work with Word 2010, neither with a JPG nor a GIF. I stored those files as doc and not docx, so there shouldn't be any incompatible tags in there either. – private_meta Apr 9 '11 at 12:47
show 1 more comment

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.