//--- Create a WordApplication and open a Document
WordApplication wordApp = new WordApplication();
Document doc = wordApp.Create();
//--- Create the HTMLToWord object
HTMLToWord h2w = new HTMLToWord();
//--- Create the font to use when inserting HTML
//--- Start by getting the "Normal" font from the Document
Font font = doc.Styles[NamedStyle.BuiltIn.Normal].Font;
//--- Change the font to 10 pt. Arial with red text
font.FontName = "Arial";
font.FontSize = 10;
font.TextColor = System.Drawing.Color.Red;
//--- Set this as the default font on the HTMLToWord object
h2w.InsertProperties.DefaultFont = font;
//--- Insert the htmlFragment at the end of the document.
h2w.InsertHTML(htmlFragment, doc, Nothing, doc);
|