Page tree
Skip to end of metadata
Go to start of metadata

Description

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.

C#
vb.net

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.

Examples

C#
vb.net

Fields

Name

Description

FormatElementDelegate

Type for user-defined delegate method called by HTMLToWord after inserting an element.

GetImageDelegate

Type for user-defined delegate method called by HTMLToWord when an HTML img tag is encountered.

InsertElementDelegate

Type for user-defined delegate method called by HTMLToWord before inserting an element.

Properties

Name

Description

DebugLogLevel

Sets the amount of information written to the debug log file. To create a log file, you must also specify the full path of the file in the HTMLToWord.LogFileName property. If no errors occur then HTMLToWord does not generate a log file.

FormatDelegate

User-assigned delegate method that is called after HTMLToWord inserts an Element into the Word document. The user may implement code to perform additional formatting or post-processing on the Element inserted into the document. If this delegate is not set, HTMLToWord simply continues processing.

ImageDelegate

User-assigned delegate method that allows users to provide an implementation for retrieving the contents of an image and passing it back to HTMLToWord for insertion into a document. If not set, then HTMLToWord will not insert images into a document.

InsertDelegate

A user-assigned delegate method that HTMLToWord calls before it processes an XHTML tag. The user may implement code to perform any tasks they desire before passing control back to HTMLToWord. The return value from the delegate method specifies how HTMLToWord should behave. If this property is not set, HTMLToWord will attempt to insert the contents of the XHTML tag.

InsertProperties

Contains settings that control how unsupported HTML tags are treated and provides an override to the default font used when inserting text into the document.

LogFileName

The full path to the HTMLToWord debug log file. To create a log file, you must set the DebugLogLevel parameter to a value other than None.

Methods

Name

Description

InsertHTML(String, Document, NamedStyle, Element)

Processes the XHTML string and inserts it into the specified Word document as formatted text after the given WordWriter Element using the given NamedStyle. Returns the last Element inserted into the document.

InsertHTML(String, Document, Element)

Processes the XHTML string and inserts it into the specified Word document as formatted text after the given WordWriter Element using the document's Normal style as the default font. Returns the last Element inserted into the document.

InsertHTML(String, Document)

Processes the XHTML string and inserts it at the end of the specified Word document as formatted text using the document's Normal style as the default font. Returns the last Element inserted into the document.

Nested Classes

Name

Description

HTMLInsertProperties

The HTMLInsertProperties object is a container for properties that control the behavior of HTMLToWord. You can control how HTMLToWord handles HTML tags that it does not explicitly support, as well as set the default font used when inserting text into the Word document.

HTMLTagAction

Return value from the user-supplied InsertElementDelegate delegate method. Controls how HTMLToWord handles an XHTML tag.

LoggingLevel

A LoggingLevel value specified the amount of information written to the log file. To create a log file, you must also specify the full path for the file using the LogFileName property.
  • No labels