Hi, I'm developing an outlook addin which needs to respond to a new contact event, but it's not working.
I've tried:
No overload for 'OnAddContact' matches delegate 'NetOffice.OutlookApi.Items_ItemAddEventHandler' (CS0123)
I'm not even sure this is the right event, but it would be nice to get it compiled at least.
A handler for a new contact event can't be hard can it?
Thanks.
I've tried:
void Addin_OnStartupComplete(ref Array custom)
{
Outlook._NameSpace outlookNs = _outlookApplication.Session;
Outlook.MAPIFolder contactFolder = outlookNs.GetDefaultFolder(OlDefaultFolders.olFolderContacts);
contactFolder.Items.Add += new NetOffice.OutlookApi.Items_ItemAddEventHandler(OnAddContact);
}
void OnAddContact(Outlook.ContactItem item)
{
MessageBox.Show(item.FullName);
}
but it fails to compile on the line where the event handler is added:No overload for 'OnAddContact' matches delegate 'NetOffice.OutlookApi.Items_ItemAddEventHandler' (CS0123)
I'm not even sure this is the right event, but it would be nice to get it compiled at least.
A handler for a new contact event can't be hard can it?
Thanks.