0

Good day, Its my first time creating an addin and I have created an addin for outlook using netoffice developer toolbox, the button was created when i opened the message like the below image enter image description here
but i dont know how to get the the emails information(sender) and the email itself so i can use it as an attachment. I have tried to show messagebox by using this code.

 public void SendButton_Click(Office.IRibbonControl control)
    {
        MessageBox.Show("Test Description", "Test", MessageBoxButtons.OK, MessageBoxIcon.Information);         
    }

any idea on how to get these email info and the email itself ?

Thanks, Have a good day

Goenitz
  • 115
  • 1
  • 2
  • 10

1 Answers1

0

The IRibbonControl interface provides the Context property which returns an object representing the active window containing the Ribbon user interface that triggers a callback procedure. So, you may cast it to the Inspector class from the Outlook object model and use the Inspector.CurrentItem property for getting an instance of the MailItem class displayed.

Eugene Astafiev
  • 47,483
  • 3
  • 24
  • 45
  • Hello sir, i tried using the MailItem.Body and i can get the mail body but when i use MailItem.Sender.Address it doesnt seem to do anything, note that im using NetOffice plugin – Goenitz Aug 10 '15 at 03:44