none
Extract entity strings from an Outlook item using VSTO (Outlook client not O365 based Office Add-ins) RRS feed

All replies

  • Hi Manoj,

    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 for MailItem members.


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

    Best Regards,

    Simon


    MSDN Community Support Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread.

    Friday, August 24, 2018 3:01 AM
    Moderator
  • This question is not about accessing email item. It's about extract entity strings out of subject, body text. Most of these entities rely on natural language recognition.

    Please refer link I have provided in my question for understanding. 


    ManojPatel

    Friday, August 24, 2018 10:27 AM
  • Sorry for late response. According to my research, VSTO does not have a method for extracting entity strings of Outlook Item.

    However, for message content items in VSTO, you can try to use Regular Expression to create a rule(Phone, Email) and then match the message body. In short, a regular expression is used to match a long string. This may not be the best approach, but hopefully it will give you a new idea.

    Best Regards,

    Simon


    MSDN Community Support Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread.

    Wednesday, August 29, 2018 2:33 PM
    Moderator
  • Thanks Simon for your response.

    I could think only that option with VSTO however, I am looking for an option through outlook exchange which identifies any instances of well-known entities in the subject and body. But looks like that is something not possible with VSTO.

    Thanks,

    Manoj


    ManojPatel

    Wednesday, August 29, 2018 5:02 PM
  • Thanks for you feedback. If you have any question, or update, please feel free to let me know. Also, please remember to mark the replies as answers if they helped and help us close the thread.

    Thank you for understanding. I wish you a happy life.

    Best Regards,
    Simon



    MSDN Community Support Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread.



    Monday, September 3, 2018 5:37 AM
    Moderator