vsto - Open EML file in Outlook using Add-In? -
using outlook add-in (vsto) can open eml file disk , "display" it?
i've tried this...
dim filename string = "c:\test\_test.eml" dim mail outlook.mailitem = ctype(globals.thisaddin.application.session.openshareditem(filename), outlook.mailitem) mail.display()
but outlook throws exception saying path not valid though is.
any idea?
openshareditem not work eml files. outlook object model not let access eml files. can either
parse eml file (or use available component), create new item in outlook , set properties 1 @ time
if using c++ or delphi, have used iconvertersession mapi interface import data
if using redemption option, can use following (off top of head):
dim session redemption.rdosession = createobject("redemption.rdosession") session.mapiobject = me.application.session.mapiobject dim drafts redemption.rdofolder = session.getdefaultfolder(olfolderdrafts) dim mail redemption.rdomail = drafts.items.add mail.sent = true mail.import "c:\temp\test,eml", 1024 'olrfc922 mail.save 'now reopen in oom dim omail outlook.mailitem = me.application.session.getitemfromid(mail.entryid) dim forwardedmail outlook.mailitem = omail.forward forwardedmail.display()
Comments
Post a Comment