Word 2003 .DOC formatting lost in HTML Emails

3

1

A Word .DOC I've created and would like to send via HTML email loses it's formatting when sent in an email. With Word DOC open can choose "Save as HTML" and it looks fine as long as viewing from within the Word program.

This age old problem is addressed by Jeff Atwood's post at http://www.codinghorror.com/blog/archives/000485.html but I'm not educated enough in computer programming or HTML to make use of his wisdom.

Is there another way to explain the process I should follow, or simplier tools to use for a novice. Thank you.

user16691

Posted 2009-11-04T14:09:29.047

Reputation:

@Johan, I doubt this is specific to Word 2003? (Even more, there was only 1 question using that tag. I guess that tag should be merged into "word" some day...) – Arjan – 2009-11-04T16:02:34.690

I believe the microsoft-word tag is the standard going tag for Word questions. – Travis – 2009-11-04T16:32:05.783

Answers

13

Actually, the app does work for what he wants. Here's how I did it on his behalf (he emailed me directly, and I asked that he post it here so others could benefit from the info...)

  1. save the document as "Filtered HTML" from Microsoft Word. This creates a HTML file.

  2. Downloaded the WordHtmlCleaner application.

  3. Ran it:

    C:\>WordHtmlCleaner.exe word-doc.htm
    input html is 33424 chars
    cleaned html is 20776 chars
    

This strips out most of the crazy "filtered" HTML that word creates, and leaves us with the file

word-doc.modified.htm

Note, I had to download the the console app code and fiddle with the encoding to get the desired results -- like so.

string html;
html = File.ReadAllText(filepath, 
       System.Text.Encoding.GetEncoding("windows-1252"));

Then open the html file in the browser, and copy-paste it into the email.

The net result is simplified HTML that has some chance of copy-pasting correctly, instead of Word's mind-bending crazytown HTML.

Jeff Atwood

Posted 2009-11-04T14:09:29.047

Reputation: 22 108

11

Actually, Jeff's post is not about email. And HTML in email kind of has its own capabilities, nicely summed up in CampaignMonitor's Guide to CSS support in email clients.

So, for starters: don't take HTML to extremes in email.

Next, the easiest way to allow an email client to clean up (and to add a plain-text alternative to the message as well): just copy from Word and paste into that email client. So: do not manually use Save as HTML.

If that doesn't work for you: what if you set up Word to be the editor in your email client? (Rather than saving as HTML manually, and rather than copy and paste, maybe Word works differently when invoked from an email client.)

And above all: what features are you missing in the editor that is built-in of your email client? (Most clients work fine, using enriched text rather than full blown HTML.)

Arjan

Posted 2009-11-04T14:09:29.047

Reputation: 29 084

this is also good advice. In general if you want to send HTML, start with HTML, otherwise you will be in a world of pain.. – Jeff Atwood – 2009-11-04T15:07:31.837

2

I see a couple of solutions. Assuming this is an isolated issue not a process that requires automation.

Try

  • Copy and paste the text into a new email

If your email client chokes on the formatting

  • Send Word Document as an attachment.

If recipient doesn't want a Word document and the formatting isn't a nightmare (and your client choked?)

  • Save a copy as an RTF document and attach that

If the formatting is beyond that capabilities of RTF

  • Install the Microsft Save as PDF plugin (2007 version) and attach a pdf.

Edit:

Apparently only Office 2007 has a PDF export plugin from Microsoft. Alternately for 2003 you can try exporting the document as a TIFF.

You can also have the person your emailing download the Word 2003 viewer program assuming they can install the software.

epochwolf

Posted 2009-11-04T14:09:29.047

Reputation: 262