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

  1. parse eml file (or use available component), create new item in outlook , set properties 1 @ time

  2. if using c++ or delphi, have used iconvertersession mapi interface import data

  3. 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

Popular posts from this blog

javascript - jQuery: Add class depending on URL in the best way -

caching - How to check if a url path exists in the service worker cache -

Redirect to a HTTPS version using .htaccess -