Quantcast
Channel: NetOffice - MS Office in .NET
Viewing all articles
Browse latest Browse all 1741

New Post: Handle Outlook new contact event

$
0
0
Hi, I'm developing an outlook addin which needs to respond to a new contact event, but it's not working.
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.

Viewing all articles
Browse latest Browse all 1741

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>