Skip to content

Instantly share code, notes, and snippets.

@aspose-com-gists
Last active November 22, 2023 03:39
Show Gist options
  • Save aspose-com-gists/1dbc5b4bf28dba34207d9bb94cbc149e to your computer and use it in GitHub Desktop.
Save aspose-com-gists/1dbc5b4bf28dba34207d9bb94cbc149e to your computer and use it in GitHub Desktop.
Email to Word and Word to Email Conversion
import aspose.words as aw
msg= MailMessage.load(dir + "msgtemplate.msg")
msg.save("htmloutput.html", SaveOptions.default_html)
doc = aw.Document("htmloutput.html")
doc.save("emailtoword.docx")
import aspose.words as aw
doc = aw.Document("wordtoemail.docx")
doc.save("htmloutput.html")
msg= MailMessage.load(dir + "htmloutput.html")
msg.save("emloutput.eml", SaveOptions.default_eml)
@Stan5312
Copy link

Stan5312 commented Dec 5, 2022

hi, I try to execute "word to email" but error log as ["SaveOptions" is not definedPylance].
What applicatio should I install?
Cloud you help me to fix the error message?

2022-12-05 16 06 31_DESKTOP-LB5TB4I

@sanglist
Copy link

Missing definition for MailMessage . . .

@Stan5312
Copy link

oh, I see, thank you, I will try it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment