If you are going to add event handlers you need to match their signatures
with the signature of the event you are planning to handle.
If you were to look in the Object Browser for the signature for the
ItemAdd() event you would see that there's an object passed to the handler
to tell it what was added.
--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007.
Reminder Manager, Extended Reminders, Attachment Options.
http://www.slovaktech.com/products.htm
"Mark B" wrote in message
...
From ThisAddIn_Startup I call mAddSentItemsHandler:
public void mAddSentItemsHandler()
{
Outlook.MAPIFolder sentItemsFolder =
Globals.ThisAddIn.Application.GetNamespace("MAPI") .GetDefaultFolder
Microsoft.Office.Interop.Outlook.OlDefaultFolders. olFolderSentMail);
sentItemsFolder.Items.ItemAdd += new
Microsoft.Office.Interop.Outlook.ItemsEvents_ItemA ddEventHandler(Application_SentItemsAdditionHandle r);
}
public void Application_SentItemsAdditionHandler()
{
MessageBox.Show("Sent");
}
I get the following error with a red underline under
Application_SentItemsAdditionHandler in the mAddSentItemsHandler method:
Error 7 No overload for 'Application_SentItemsAdditionHandler' matches
delegate
'Microsoft.Office.Interop.Outlook.ItemsEvents_Item AddEventHandler'
C:\Users\Mark\Desktop\MyAddin\ThisAddIn.cs 325 46 MyAddin