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

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.

Signature
C#
C#
 public SoftArtisans.OfficeWriter.WordWriter.Element InsertHTML(System.String xhtml, SoftArtisans.OfficeWriter.WordWriter.Document doc, SoftArtisans.OfficeWriter.WordWriter.Element insertAfterElement)
Signature
vb.net
vb.net
Public Function InsertHTML(ByVal xhtml As String, ByVal doc As SoftArtisans.OfficeWriter.WordWriter.Document, ByVal insertAfterElement As SoftArtisans.OfficeWriter.WordWriter.Element) As SoftArtisans.OfficeWriter.WordWriter.Element
Parameters
Param
xhtml
xhtml

A well-formed fragment of an xhtml document.

Param
doc
doc

a WordWriter document object into which content will be inserted.

Param
insertAfterElement
insertAfterElement

The WordWriter element after which the contents of the xhtml will be inserted.

Returns

The last Element inserted into the document.

Example
Code Block
csharp
csharp
titleC#

 //--- Create a new WordWriter document.
 WordApplication wApp = new WordApplication(); 
 Document doc = wApp.Create();
 
 //--- Create the HTMLToWord object.
 HTMLToWord h2w = new HTMLToWord();
 
 //--- The XHTML to insert into the WordWriter document.
 string xhtml = "<h1>Greetings</h1><p><b>Hello</b>, <i>world</i>!</p>";
 
 //--- Insert the XHTML at the end of the WordWriter document.
 Element lastInsertedElement = h2w.InsertHTML(xhtml, doc, null, doc);
                    
Code Block
vb.net
vb.net
titlevb.net

 '--- Create a new WordWriter document.
 Dim wApp As New WordApplication()
 Dim doc As Document = wApp.Create()
 
 '--- Create the HTMLToWord object.
 Dim h2w As New HTMLToWord()
 
 '--- The XHTML to insert into the WordWriter document.
 Dim xhtml As String = "<h1>Greetings</h1><p><b>Hello</b>, <i>world</i>!</p>"
 
 '--- Insert the XHTML at the end of the WordWriter document.
 Dim lastInsertedElement As Element = h2w.InsertHTML(xhtml, doc, null, doc)