Convert HTML to / from Word document in C# and VB.NET

Convert HTML to / from Word (DOCX) and Word 2003 (DOC) documents in C# and VB.NET with GemBox.Document component.

GemBox.Document is a C# / VB.NET component that enables developers to read, write, convert and print document files (DOCX, DOC, PDF, HTML, XPS, RTF and TXT) from .NET applications in a simple and efficient way without the need for Microsoft Word on either the developer or client machines.
GemBox.Document Free is free of charge while GemBox.Document Professional is a commercial version licensed per developer.
For more information, see GemBox.Document features and why GemBox.Document outperforms Word automation.

Following example converts Word 2003 (DOC) document to HTML, HTML to Word (DOCX) document and converts back DOCX to HTML.

C# code

// Convert Word 2003 (DOC) document to HTML.
DocumentModel.Load("Document.doc").Save("Document.html");

// Convert HTML to Word (DOCX) document.
DocumentModel.Load("Document.html").Save("Document.docx");

// Convert Word (DOCX) document to HTML.
DocumentModel.Load("Document.docx").Save("Document.html");

VB.NET code

' Convert Word 2003 (DOC) document to HTML.
DocumentModel.Load("Document.doc").Save("Document.html")

' Convert HTML to Word (DOCX) document.
DocumentModel.Load("Document.html").Save("Document.docx")

' Convert Word (DOCX) document to HTML.
DocumentModel.Load("Document.docx").Save("Document.html")