Problems with ItemSend event in Add In

G

Geoff

I am having problems getting the ItemSend event to fire (and even compile) within my .NET Add In. My code is as follows

Dim WithEvents applicationObject As Outlook.Applicatio
...
Public Sub OnConnection(ByVal application As Object, ByVal connectMode As Extensibility.ext_ConnectMode, ByVal addInInst As Object, ByRef custom As System.Array) Implements Extensibility.IDTExtensibility2.OnConnectio
applicationObject = applicatio
End Su
..
Private Sub applicationObject_ItemSend(ByVal Item As Object, ByVal Cancel As Boolean) _
Handles applicationObject.ItemSen
MsgBox("item send"
End Su

The code above will not compile and gives the following error
"Method 'applicationObject_ItemSend' cannot handle Event 'ItemSend' because they do not have the same signature.

When I remove the 'Handles...' clause from the function, the code will compile, but the event doesn't fire. Am I missing something?

ANY help is greatly appreciated. Thanks
 

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