//--- Well-formed HTML fragment to be inserted into the document.
string htmlFragment = @"<{span}{/span}p><{span}{/span}b>Hello,<{span}{/span}/b><{span}{/span}i> World<{span}{/span}/i>!<{span}{/span}/p>";
//--- Open an existing Word document with the SoftArtisans WordApplication object.
WordApplication wApp = new WordApplication();
Document doc = wApp.Open("myDoument.doc");
//--- Create the HTMLToWord object.
HTMLToWord h2w = new HTMLToWord();
//--- Insert the HTML fragment at the end of the document.
//--- Use the default style.
h2w.InsertHTML(htmlFragment, doc, null, doc);
|