Outlook 2010 - C# - Get the account associated to a mail -
i'm creating outlook add-in can save selected emails external database.
using office.iribboncontrol
can list of selected email, need know account mails associated.
i mean, if outlook messages toto@exemple.com
, otot@exemple.com
, when want save message need know information.
i can't use informations sender / receiver because can outcome income email.
currently, have found using current folder path..
public void sayhello(office.iribboncontrol control) { messagebox.show( "folder: " + (control.context outlook.explorer).currentfolder.folderpath, "test", messageboxbuttons.ok, messageboxicon.information); }
but method isn't enough. if open message (in separated window) , change current folder, fails.
also, outlook.explorer.currentaccount
not work expected.
so here question : how can access related account having outlook.mailitem
object ?
you can parent folder (mailitem.parent
) of outlook.mailitem
determine folder path (folder.folderpath
).
outlook.folder parent = mailitem.parent outlook.folder; string itempath = parent.folderpath;
Comments
Post a Comment