I have a little experience in add-ins with c#, but I believe that you will understand the concept.
I believe that you should use Microsoft.Office.Interop classes with COM to create it.
To find the current selected Microsoft.Office.Interop.Outlook.MailItem you can use this:
Outlook.MailItem Email = null;
Outlook.Inspector actInspector = Outlook.Application.ActiveInspector();
if (actInspector == null)
{
Outlook.Explorer explorer = Outlook.Application.ActiveExplorer();
try
{
Email = explorer.GetType().InvokeMember("ActiveInlineResponse", System.Reflection.BindingFlags.GetProperty | System.Reflection.BindingFlags.Instance |
System.Reflection.BindingFlags.Public, null, explorer, null) as Outlook.MailItem;
}
finally
{
Marshal.ReleaseComObject(explorer);
}
}
else
{
try
{
Email = actInspector.CurrentItem as Outlook.MailItem;
}
finally
{
if (actInspector != null) Marshal.ReleaseComObject(actInspector);
}
}
this came from
http://stackoverflow.com/questions/40973773/how-to-reliably-know-what-object-is-current-in-focus-outlook-window-i-e-an-e/40979666#40979666
To get all MailItem selectes in explorer you can use this:
Outlook.Explorer explorer = null;
Outlook.Selection selection = null;
try
{
explorer = Global.OutlookApp.ActiveExplorer();
selection = explorer.Selection;
foreach (MailItem item in selection)
{
}
}
finally
{
if (selection != null)
Marshal.ReleaseCOMObject(selection);
if (explorer != null)
Marshal.ReleaseCOMObject(explorer);
}