You can read all details at: Convert Word DOC or DOCX to HTML, MHTML in C# VB.NET
Created
January 19, 2021 20:13
-
-
Save aspose-com-gists/55fefeb42d0a2829672e78eaed4c7b38 to your computer and use it in GitHub Desktop.
Convert Word DOC or DOCX to HTML, MHTML in C# VB.NET
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Load the document from disk. | |
Document doc = new Document(dataDir + "Test File.docx"); | |
// Set HtmlSaveOptions | |
HtmlSaveOptions options = new HtmlSaveOptions(); | |
options.SaveFormat = SaveFormat.Html; | |
// Save the document into HTML | |
doc.Save(dataDir + "Document.html", options); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Load the document from disk. | |
Document doc = new Document(dataDir + "Test File (doc).docx"); | |
HtmlSaveOptions options = new HtmlSaveOptions(); | |
// HtmlSaveOptions.ExportRoundtripInformation property specifies | |
// Whether to write the roundtrip information when saving to HTML, MHTML or EPUB. | |
// Default value is true for HTML and false for MHTML and EPUB. | |
options.ExportRoundtripInformation = true; | |
doc.Save(dataDir + "ExportRoundtripInformation_out.html", options); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Load the document from disk. | |
Document doc = new Document(dataDir + "Test File.docx"); | |
// Set HtmlSaveOptions | |
HtmlSaveOptions options = new HtmlSaveOptions(); | |
options.SaveFormat = SaveFormat.Mhtml; | |
// Save the document into MHTML | |
doc.Save(dataDir + "Document.mhtml", options); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment