Word – Paste HTML into Word

htmlmicrosoft wordstyles

I'm have a tough time getting my HTML that I am pasting into word to be converted to the proper styles I want.

My HTML includes: dt, dd, h1h7, p, li, ul… etc.

dt and dd are not working. Word thinks they are paragraphs and applies the "Normal" style to them.

h1h7 work great.

li works great.

What can I put into word so that when I paste in these dt & dd they will select a proper style?

EDIT:
I certainly appreciate the responses received so far, however nobody has really answered this yet. I cannot decide what the export medium is for this job, as I am not the decision maker. The requirement is MS Word files. There will be headers and footers, page numbering and a table of contents to the project, but whenever I paste HTML into Word the same problem happens: certain tags are styled and others are ignored.

My guess is that this is a deficiency/bug in MS Word, so I will go ahead and open a ticket with Microsoft.

Best Answer

I have found a suitable answer to this.

  • By stylizing each HTML object in the source, Word will then apply styles if you "paste" with the option "Keep source formatting", most of the kinds of CSS will be converted into a Word style.

eg:

This will have the same formatting in HTML when you copy/paste to Word with "Keep Formatting" selected.

<h1 style="border:1px solid #CCC;font-size:1.5em">Title</h1>
Related Question