Skip to main content
A newer version of this page is available. .

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);