Closed InteXX closed 1 month ago
I found the answer here:
private void Initialize()
{
outlookApp = new Outlook.Application();
outlookNS = outlookApp.GetNamespace("MAPI");
inboxFolder = outlookNS.GetDefaultFolder(OlDefaultFolders.olFolderInbox);
items = (Outlook.Items) inboxFolder.Items;
items.ItemAddEvent +=
new Outlook.Items_ItemAddEventHandler(items_ItemAdd);
}
We have to cast oInboxFolder.Items
to OutlookApi.Items
first.
Is Outlook event handling available, e.g. the ability to respond when an email is moved to a folder?
I think it must be. I've located
NetOffice.OutlookApi.Items.ItemAddEvent
in the source, but it's not clear how to get to that in my consuming code.This code fails to compile:
Again, I'm not finding any documentation for this.
Please advise.