Search code examples
c#outlookvstooutlook-addinmailitem

How can I get a not underlined email address, written in the To textbox, in mailItem.To?


enter image description here

I can get the [email protected] mail address in the To property in the mailItem object but I can't get [email protected] that is not underlined in the To property of the mailItem object.

enter image description here

mail.Recipients with protag not found in all mails.

How can I directly get everything written in mailItem.To


Solution

  • Outlook caches data and doesn't propagate your changes to the Outlook object model immediately or in the opposite side - changes made via OOM programmatically until you switch to another field in the UI or just re-open an item.

    Also you may try to call the Save method to get the item saved to the store with all changes. Most probably you'll have to move the focus to another control on the UI.