0
votes

With web based Office add-ins, outlook provides APIs to extract entity strings (Address, contacts, email address etc.) from an Outlook item subject, body fields.

Please refer below articles. https://docs.microsoft.com/en-us/outlook/add-ins/extract-entity-strings-from-an-item

https://docs.microsoft.com/en-us/outlook/add-ins/match-strings-in-an-item-as-well-known-entities

Is there any similar thing available for COM based outlook plugins (VSTO) ? If not in built with Outlook API then any Microsoft service which we can use to pass text and get such results can also help.

Thanks, Manoj

1
Did you find a way to do that ?Fabske

1 Answers

0
votes

Yes, you can retrieve outlook email item by using VSTO. Here is the test code below:

private void InternalStartup()
    {

        var inbox = this.Application.ActiveExplorer().Session.GetDefaultFolder (Outlook.OlDefaultFolders.olFolderInbox);
        var mailItem = inbox.Items[1] as Outlook.MailItem;
        var subject = mailItem.Subject;
        var body = mailItem.Body;

        MessageBox.Show(string.Format("Subject = {0}, Body = {1}", subject,body));
    }

You can have a look this MSDN document below for MailItem members https://msdn.microsoft.com/en-us/library/microsoft.office.interop.outlook.mailitem_members.aspx

For your additional question, you can use EWS (Exchange Web Server) to retrieve your email item.