Open, read, convert Word 2003 (DOC) in C# and VB.NET

Open and read Word 2003 (DOC) file and convert it to other formats (DOCX, PDF, HTML) 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 opens and reads Word 2003 (DOC) file and converts it to DOCX, PDF and HTML formats.

C# code

// Load Word 2003 (DOC) file.
var document = DocumentModel.Load("Document.doc");

// Write document content to Console.
Console.WriteLine(document.Content);

// Convert Word 2003 (DOC) to DOCX.
document.Save("Document.docx");

// Convert Word 2003 (DOC) to PDF.
document.Save("Document.pdf");

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

VB.NET code

' Load Word 2003 (DOC) file.
Dim document = DocumentModel.Load("Document.doc")

' Write document content to Console.
Console.WriteLine(document.Content)

' Convert Word 2003 (DOC) to DOCX.
document.Save("Document.docx")

' Convert Word 2003 (DOC) to PDF.
document.Save("Document.pdf")

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