Exception on saving Word to EML file format
Traceback (most recent call last):
File “D:\kb-python\kbconversion.py”, line 22, in
converter.convert(“output.eml”, convert_options)
RuntimeError: Proxy error(ConversionNotSupportedException): Conversion from docx (Word Processing) to eml (Email) is not supported.
ref : Convert a Document to Another Format | Documentation
import os
from groupdocs.conversion import License, Converter
from groupdocs.conversion.options.convert import EmailConvertOptions
from groupdocs.conversion.filetypes import EmailFileType
# If you have a license, uncomment the following lines to set it
license_path = os.path.abspath("./GroupDocs.Conversion.lic")
if os.path.exists(license_path):
# Create License and set the path
license = License()
license.set_license(license_path)
# Load the source DOCX file
converter = Converter("input.docx")
# Set conversion options for EML format
convert_options = EmailConvertOptions()
# Set output email format as EML
convert_options.format = EmailFileType.EML
# Convert DOCX to EML
converter.convert("output.eml", convert_options)
# Print success message
print("Conversion completed successfully.")
input.docx (303.7 KB)