Handling Task Item Delete Event

A

AtulSureka

Hi,

I am trying to capture the Delete Task Item Event.
For that I am handling the ItemRemove event of Task folder.
But handling this event does not provide me the Task Item which is deleted.
How to get the task item within the event handler ??????

I have used the following code for the same.

using System;
using Outlook = Microsoft.Office.Interop.Outlook;

namespace OutlookManager
{
class Program
{
static void Main(string[] args)
{

Outlook.Application application = new Outlook.Application();
Outlook.NameSpace nameSpace = application.GetNamespace("MAPI");

Outlook.MAPIFolder folder =
nameSpace.GetDefaultFolder(Outlook.OlDefaultFolders.olFolderTasks);

folder.Items.ItemRemove += new
Microsoft.Office.Interop.Outlook.ItemsEvents_ItemRemoveEventHandler(Items_ItemRemove);

Console.ReadLine();
}

static void Items_ItemRemove()
{
Console.WriteLine("Some item has been removed");
}

}
}


Regards
Atul Sureka
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top