The following example shows you how to import an HTML document into a Word document. The LoadFromHtml method converts HTML elements to Word format, preserving text formatting, tables, hyperlinks, and other elements.
C# example - Load from HTML file
C# example - Load from HTML string
VB example
HTML elements supported:
Headings (h1-h6) with automatic formatting
Paragraphs (p, div) with alignment and spacing
Text formatting (b, strong, i, em, u, s, strike, del)
Font tags with color, face, and size attributes
Span elements with inline CSS styles
Superscript (sup) and subscript (sub)
Tables (table, tr, td, th) with styling
Lists (ul, ol, li) converted to numbered/bulleted lists