Last active
March 31, 2022 05:16
-
-
Save groupdocs-com-kb/b3d5dfcc96fccb98c9e266917761bbdb to your computer and use it in GitHub Desktop.
How to Convert Word Document to HTML using C#. For more information, please follow link: https://kb.groupdocs.com/conversion/net/how-to-convert-word-document-to-html-using-csharp/
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
using System; | |
using GroupDocs.Conversion.Options.Convert; | |
namespace ConvertWordDocumentToHtmlUsingCSharp | |
{ | |
class Program | |
{ | |
public static void Main(string[] args) // Main function to convert Word Document to HTML using C# | |
{ | |
// Remove the watermark in output HTML file by adding license | |
string licensePath = "GroupDocs.Conversion.lic"; | |
GroupDocs.Conversion.License lic = new GroupDocs.Conversion.License(); | |
lic.SetLicense(licensePath); | |
// Load the source Word file for conversion to HTML | |
var converter = new GroupDocs.Conversion.Converter("sample.docx"); | |
// Set the convert options for HTML file | |
var convertOptions = new MarkupConvertOptions(); | |
// Convert and save the DOCX in HTML format | |
converter.Convert("converted.html", convertOptions); | |
Console.WriteLine("Done"); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment