Hello,
Please refer to this link for a full code sample of add button in Outlook Explorer:
http://msdn.microsoft.com/en-us/library/ms268864.aspx In button click event use code to access the current selected mail item:
Application.ActiveExplorer().Selection[1] as Outlook.MailItem;
For more inforamtion about Selection object please refer to:
http://msdn.microsoft.com/en-us/library/bb219970.aspxThanks
We have published a VSTO FAQ recently, you can view them from the entry thread
VSTO FAQ.
If you have any feedbacks or suggestions on this FAQ, please feel free to write us emails to colbertz@microsoft.com.
Please remember to mark the replies as answers if they help and unmark them if they provide no help.
Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.