Skip to content

Instantly share code, notes, and snippets.

How to Convert Outlook Email to Word in C#. For more information, please follow link: https://kb.conholdate.com/total/net/how-to-convert-outlook-email-to-word-in-csharp
using System;
using GroupDocs.Conversion.Options.Convert;
namespace ConvertOutlookEmailToWordInCSharp
{
class Program
{
public static void Main(string[] args) // Main function to convert Outlook email to Word using C#
{
// Remove the watermark in output Word document by adding license
string licensePath = "GroupDocs.Conversion.lic";
GroupDocs.Conversion.License lic = new GroupDocs.Conversion.License();
lic.SetLicense(licensePath);
// Load the source EML file for conversion to Word
var converter = new GroupDocs.Conversion.Converter("sample.eml");
// Set the conversion options for Word document to customize the output file
WordProcessingConvertOptions options = new WordProcessingConvertOptions();
// Convert and save the EML in DOCX format
converter.Convert("converted.docx", options);
Console.WriteLine("Done");
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment