Hallo zusammen!
Ich möchte gerne in dem aktuellen Ordner die ausgewählte eMail finden, um es in ein anderes Ordner verschieben zu können.
Es soll so ungefähr aussehen:
Outlook.Explorer outlookExplorer = this.Application.ActiveExplorer();
Outlook.MAPIFolder inBox = outlookExplorer.CurrentFolder;
Outlook.Items items = inBoxItems;
foreach (Outlook.MailItem eMail in items)
{
//Hier nur ausgewählte eMails in ein anderes Ordner verschieben:
//IF eMail = selected THEN
// VERSCHIEBE();
}
Die Frage leutet also, wie finde ich eine selektierte eMail?
Hab die Lösung gefunden:
using Outlook = Microsoft.Office.Interop.Outlook;
Outlook.Explorer outlookExplorer = this.Application.ActiveExplorer();
Outlook.MailItem mail = (Outlook.MailItem)outlookExplorer.Selection[1]; //Nimm erste selektierte eMial