How To: Convert a DOCX Document to HTML format

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

server.LoadDocument("Documents\\MovieRentals.docx", DocumentFormat.OpenXml);
string filePath = "Document_HTML.html";
using (FileStream htmlFileStream = new FileStream(filePath, FileMode.Create))
{
    server.SaveDocument(htmlFileStream, DocumentFormat.Html);
}

System.Diagnostics.Process.Start(filePath);