Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migration of unmigrated content due to installation of a new plugin
Excerpt Include
HTMLToWord Object
HTMLToWord Object
nopaneltrueHTMLToWord Object

Table of Contents

Table of Contents

...

For an overview of how to use the HTMLToWord object, see Using HTMLToWord.

Examples:

Code Block
c#
c#
titleC#c#
//--- Well-formed HTML fragment to be inserted into the document.
string htmlFragment = @"<p><b>Hello,</b><i> World</i>!</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);
Code Block
vb.net
vb.net
titleVB.NETvb.net
'--- Well-formed HTML fragment to be inserted into the document.
Dim htmlFragment As String = "<p><b>Hello,</b><i> World</i>!</p>"

'--- Open an existing Word document with the SoftArtisans WordApplication object.
Dim wApp As WordApplication = new WordApplication
Dim doc As Document = wApp.Open("myDoument.doc")

'--- Create the HTMLToWord object.
Dim h2w As HTMLToWord = new HTMLToWord

'--- Insert the HTML fragment at the end of the document.
'--- Use the default style.
h2w.InsertHTML(htmlFragment, doc, Nothing, doc)

...