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
Description

Excerpt

Use the HTMLToWord object to insert well-formed HTML (XHTML) text into a WordWriter Document object. You can specify a style to use when inserting text or use the document's default style. You can also specify whether to insert text after a specific element or at the end of a document.

Signature
C#
C#
 public class HTMLToWord
Signature
vb.net
vb.net
Public Class HTMLToWord
Remarks

The contents of HTML tags not listed on the HTMLToWord Supported Tags may be inserted into the document as plain text. The behavior is dependent on the settings of the AcceptUnknownTags and IncludeContentsOfUnknownTags properties found in the HTMLInsertProperties property container.

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

Example
Code Block
csharp
csharp
titleC#

//--- 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);
Code Block
vb.net
vb.net
titlevb.net

'--- Well-formed HTML fragment to be inserted into the document.
Dim htmlFragment As String = "<{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.
Dim wApp As New WordApplication()
Dim doc As Document = wApp.Open("myDoument.doc")

'--- Create the HTMLToWord object.
Dim h2w As New HTMLToWord()

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

Name

Description

FormatElementDelegate

Excerpt Include
HTMLToWord.FormatElementDelegate
HTMLToWord.FormatElementDelegate
nopaneltrue

GetImageDelegate

Excerpt Include
HTMLToWord.GetImageDelegate
HTMLToWord.GetImageDelegate
nopaneltrue

InsertElementDelegate

Excerpt Include
HTMLToWord.InsertElementDelegate
HTMLToWord.InsertElementDelegate
nopaneltrue
Properties

Name

Description

DebugLogLevel

Excerpt Include
HTMLToWord.DebugLogLevel
HTMLToWord.DebugLogLevel
nopaneltrue

FormatDelegate

Excerpt Include
HTMLToWord.FormatDelegate
HTMLToWord.FormatDelegate
nopaneltrue

ImageDelegate

Excerpt Include
HTMLToWord.ImageDelegate
HTMLToWord.ImageDelegate
nopaneltrue

InsertDelegate

Excerpt Include
HTMLToWord.InsertDelegate
HTMLToWord.InsertDelegate
nopaneltrue

InsertProperties

Excerpt Include
HTMLToWord.InsertProperties
HTMLToWord.InsertProperties
nopaneltrue

LogFileName

Excerpt Include
HTMLToWord.LogFileName
HTMLToWord.LogFileName
nopaneltrue
Methods

Name

Description

InsertHTML(String, Document, NamedStyle, Element)

Excerpt Include
HTMLToWord.InsertHTML(String, Document, NamedStyle, Element)
HTMLToWord.InsertHTML(String, Document, NamedStyle, Element)
nopaneltrue

InsertHTML(String, Document, Element)

Excerpt Include
HTMLToWord.InsertHTML(String, Document, Element)
HTMLToWord.InsertHTML(String, Document, Element)
nopaneltrue

InsertHTML(String, Document)

Excerpt Include
HTMLToWord.InsertHTML(String, Document)
HTMLToWord.InsertHTML(String, Document)
nopaneltrue
Classes

Name

Description

HTMLInsertProperties

Excerpt Include
HTMLToWord.HTMLInsertProperties
HTMLToWord.HTMLInsertProperties
nopaneltrue

HTMLTagAction

Excerpt Include
HTMLToWord.HTMLTagAction
HTMLToWord.HTMLTagAction
nopaneltrue

LoggingLevel

Excerpt Include
HTMLToWord.LoggingLevel
HTMLToWord.LoggingLevel
nopaneltrue