visual-studio-2010vstooutlook-2010

How to access MailItem from UserControl?


hey guys, i have a usercontrol within the default email compose form, I want to get the mailitem of that window.

Is there an easy way to do this?


Solution

  • Since you are composing an email, you must be in an Outlook Inspector. So you would have code like this:

    Inspector inspector = window as Inspector;
    MailItem mailItem = inspector.CurrentItem as MailItem;