Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save conholdate-com-kb/315de44bfeee62e23b3a35ad2a19738f to your computer and use it in GitHub Desktop.
Save conholdate-com-kb/315de44bfeee62e23b3a35ad2a19738f to your computer and use it in GitHub Desktop.
How to Convert Outlook Email to Word in Java. For more information, please follow link: https://kb.conholdate.com/total/java/how-to-convert-outlook-email-to-word-in-java
import com.groupdocs.conversion.Converter;
import com.groupdocs.conversion.licensing.License;
import com.groupdocs.conversion.options.convert.WordProcessingConvertOptions;
public class ConvertOutlookEmailToWordInJava {
public static void main(String[] args) { // Main function to convert Outlook email to Word in Java
// Remove the watermark in output Word document by adding license
License lic = new License();
lic.setLicense("GroupDocs.Conversion.lic");
// Load the source EML file for conversion to Word
Converter converter = new Converter("sample.eml");
// Set the convert options for DOCX format
WordProcessingConvertOptions options = new WordProcessingConvertOptions();
// Convert and save the EML in DOCX format
converter.convert("converted.docx", options);
System.out.println("Done");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment