Skip to main content

How to: Export a Document to HTML Format

This example demonstrates how to export the document to the HTML format using the RichEditControl.SaveDocument method.

The RichEditControl instance is passed to the BarItem.ItemClick event handler using the BarItem.Tag property.

View Example

Shared Sub buttonCustomAction_ItemClick_Html(ByVal sender As Object, ByVal e As ItemClickEventArgs)
    Dim richEdit As RichEditControl = TryCast(e.Item.Tag, RichEditControl)
    'Export document to the file:
    richEdit.SaveDocument("resultingDocument.html", DocumentFormat.Html)
    'Export document to the stream:
    Using htmlFileStream As New IO.FileStream("Document_HTML.html", IO.FileMode.Create)
        richEdit.SaveDocument(htmlFileStream, DocumentFormat.Html)
    End Using

End Sub
See Also