Connecting to an addin in Outlook 2010 (or not)

C

CyberEeyor

Well, this is really a VB question, but this discussion group seems to be as
close as I can get. Please redirect me if there is a better place to ask this
question.

I'm trying to set up an Outlook addin using 2010 beta. A skeleton of the
code is shown below.

When I start Outlook, the addin shows up in the list of active addin. I get
the "Mail Checker addin created" and "Mail Checker addin deleted" messages at
the appropriate times. But I never seem to enter any of the IDTExtensibility2
subroutines. Equivalently, Outlook never seems to actually connect to my
addin.

Am I missing some message handler hook-up or something. I haven't seen
anything else in any of the MSDN examples. Are addins in Outlook 2010 beta
fully operational? I will be happy to try any and all suggestions.

Thanks
CyberEeyor

Imports Outlook = Microsoft.Office.Interop.Outlook
Imports System.Runtime.InteropServices
Imports System.Reflection
Imports Extensibility

Public Class MailCheckerAddin

Implements IDTExtensibility2

Private Sub ThisAddIn_Startup(ByVal sender As Object, _
ByVal e As System.EventArgs) Handles
Me.Startup
MsgBox("Mail Checker addin created")
End Sub

Private Sub ThisAddIn_Shutdown(ByVal sender As Object, _
ByVal e As System.EventArgs) Handles
Me.Shutdown
MsgBox("Mail Checker addin deleted")
End Sub

Private Sub IDTExtensibility2_OnAddInsUpdate(ByRef custom As System.Array) _
Implements
IDTExtensibility2.OnAddInsUpdate
MsgBox("Mail Checker notified that add-in have changed.")
End Sub

Private Sub IDTExtensibility2_OnBeginShutdown(ByRef custom As
System.Array) _
Implements
IDTExtensibility2.OnBeginShutdown

End Sub

Private Sub IDTExtensibility2_OnConnection(ByVal Application As Object, _
ByVal ConnectMode As
ext_ConnectMode, _
ByVal AddInInst As Object, _
ByRef custom As System.Array) _
Implements
IDTExtensibility2.OnConnection
MsgBox("Connecting to Mailcheker addin")

End Sub

Private Sub IDTExtensibility2_OnDisconnection(ByVal RemoveMode As
ext_DisconnectMode, _
ByRef custom As
System.Array) Implements IDTExtensibility2.OnDisconnection

End Sub

Private Sub IDTExtensibility2_OnStartupComplete(ByRef custom As
System.Array) _
Implements
IDTExtensibility2.OnStartupComplete
Msgbox("Mailchecker Startup complete")
End Sub

End Class
 
K

Ken Slovak - [MVP - Outlook]

It looks to me like your addin is a mixture of a shared addin and a VSTO
addin. A VSTO addin provides the Startup() and Shutdown() events, or at
least it does if the new disconnection registry setting is turned on. A
shared addin uses extensibility. You need to make up your mind as to which
you are trying to create, you can't mix and match.

You also need to post all the relevant information, such as if you are
running Outlook 2010 in 32-bit or 64-bit mode, which will make a huge
difference.
 

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