M
Mike Belshe
I've got an outlook add-in. I'm running Outlook XP, .NET 1.1. My
Add-In is written in C#.
I'm trying to trap either the Application.ItemSend or the
MailItem.ItemSend event to put up a dialog and possibly let the user
cancel the send. I can get the events to fire, but setting the Cancel
flag doesn't work. I set Cancel to true, and the message is sent
anyway.
Here is the simple code. Again, my event handler does get called- I can
trap a breakpoint there. But, the cancel just doesn't work.
// this runs on startup, app is the application object
// handed to me by the extensibility interface
{
Outlook.Application myApp = (Outlook.Application)app;
myApp.ItemSend += new
Outlook.ApplicationEvents_10_ItemSendEventHandler(olApp_ItemSend);
}
private void olApp_ItemSend(object Item, ref bool Cancel)
{
Cancel = true;
}
Thanks!
Mike
Add-In is written in C#.
I'm trying to trap either the Application.ItemSend or the
MailItem.ItemSend event to put up a dialog and possibly let the user
cancel the send. I can get the events to fire, but setting the Cancel
flag doesn't work. I set Cancel to true, and the message is sent
anyway.
Here is the simple code. Again, my event handler does get called- I can
trap a breakpoint there. But, the cancel just doesn't work.
// this runs on startup, app is the application object
// handed to me by the extensibility interface
{
Outlook.Application myApp = (Outlook.Application)app;
myApp.ItemSend += new
Outlook.ApplicationEvents_10_ItemSendEventHandler(olApp_ItemSend);
}
private void olApp_ItemSend(object Item, ref bool Cancel)
{
Cancel = true;
}
Thanks!
Mike