How to save Word documents as HTML to be viewed in Firefox

10

1

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

private_meta

Posted 2011-04-09T12:18:25.313

Reputation: 2 204

2Can you please provide a screenshot (or partial screenshot) showing us in what what way it fails? – Majenko – 2011-04-09T13:02:42.180

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 – 2011-04-09T13:05:33.790

2using 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 – 2011-04-09T13:21:16.407

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 – 2011-04-09T13:27:36.413

Just tested in Open Office (3.2.*). It looks ok in Open Office Writer, but breaks when viewed in a browser – private_meta – 2011-04-09T13:53:42.917

Funny! I have the opposite case here. I exported several Word 2010 documents as HTML files and they show fine in Chrome (v18.0) and FF (v11), but look garbled in IE(v9). So far, I traced the offending sequence back to the header section of my Word document: I have a logo in the header and in IE it's layed multiple time and apparently arbitrarily over the text. In the other two it doesn't show up at all (which in this case is better, since the content remains visible and readable). Still investigating, though... – None – 2012-04-23T12:01:43.603

Firefox 4 is pretty much outdated, the latest version is the 20. I would try to update it and see if it helps. – Sekhemty – 2013-05-05T10:35:52.053

This seems to be affecting us in IE9, but fine in IE8, which roughly fits the timeline for this question (IE9 released 14 Mar 2011) – Stephen – 2014-06-04T00:02:43.770

Answers

-2

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

Edit: Just to clarify: I answered this myself as I didn't receive any other answer for 8 months. As I am not in need of the solution any more at the moment, and was too long ago, I will/can not accept another solution.

private_meta

Posted 2011-04-09T12:18:25.313

Reputation: 2 204

Other people may encounter the same issue, including myself. So it is a very useful question. Please be kind enough and mark the answer that you think it solves the problem.

Personally, I find @Saurabh Bagchi answer a good solution. – Alin C – 2015-09-11T07:57:01.657

6

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.

John Johnson

Posted 2011-04-09T12:18:25.313

Reputation: 61

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 – 2014-06-05T02:56:31.443

4

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">

Saurabh Bagchi

Posted 2011-04-09T12:18:25.313

Reputation: 41

2

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

Thierry Thelliez

Posted 2011-04-09T12:18:25.313

Reputation: 21

2

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.

Pok

Posted 2011-04-09T12:18:25.313

Reputation: 121

1

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.

CJM

Posted 2011-04-09T12:18:25.313

Reputation: 2 512

0

In the quick access toolbar, there is an option called Web page preview. I think this should work (I tested it when I had Word 2007 and don't know if it is available on 2010 and 2013).

UltraDEVV

Posted 2011-04-09T12:18:25.313

Reputation: 459