hi there,
i got a COM add-in and it loads fine in to outlook but if i add the
following line of code so that i can call a function from an outlook form it
doesn't load at all?
application.COM AddIns.Item("DM CRM.Connect").O bject = Me
i got this info from http://support.microsoft.com/?kbid=240768
My code is below and the function i am trying to call is tester
thanks a lot any help please
Jonathan
Imports Microsoft.Offic e.Core
Imports Microsoft.Offic e.Interop.Outlo ok
Imports Extensibility
Imports System.Runtime. InteropServices
#Region " Read me for Add-in installation and setup information. "
' When run, the Add-in wizard prepared the registry for the Add-in.
' At a later time, if the Add-in becomes unavailable for reasons such as:
' 1) You moved this project to a computer other than which is was
originally created on.
' 2) You chose 'Yes' when presented with a message asking if you wish to
remove the Add-in.
' 3) Registry corruption.
' you will need to re-register the Add-in by building the DMCRMSetup project
' by right clicking the project in the Solution Explorer, then choosing
install.
#End Region
<GuidAttribute( "572C0332-5D4C-4BF3-B8E4-943F860399B8"),
ProgIdAttribute ("DMCRM.Connect ")> _
Public Class Connect
#Region "Var"
Implements Extensibility.I DTExtensibility 2
'
'
'
Dim applicationObje ct As Object
Dim addInInstance As Object
#End Region
#Region "COM add-in"
Public Sub OnBeginShutdown (ByRef custom As System.Array) Implements
Extensibility.I DTExtensibility 2.OnBeginShutdo wn
On Error Resume Next
' Notify the user you are shutting down, and delete the button.
MsgBox("Our custom Add-in is unloading.")
End Sub
Public Sub OnAddInsUpdate( ByRef custom As System.Array) Implements
Extensibility.I DTExtensibility 2.OnAddInsUpdat e
'
End Sub
Public Sub OnStartupComple te(ByRef custom As System.Array) Implements
Extensibility.I DTExtensibility 2.OnStartupComp lete
MsgBox("Our custom Add-in is loading.")
End Sub
Public Sub OnDisconnection (ByVal RemoveMode As
Extensibility.e xt_DisconnectMo de, ByRef custom As System.Array) Implements
Extensibility.I DTExtensibility 2.OnDisconnecti on
On Error Resume Next
If RemoveMode <>
Extensibility.e xt_DisconnectMo de.ext_dm_HostS hutdown Then _
Call OnBeginShutdown (custom)
applicationObje ct = Nothing
End Sub
Public Sub OnConnection(By Val application As Object, ByVal connectMode
As Extensibility.e xt_ConnectMode, ByVal addInInst As Object, ByRef custom As
System.Array) Implements Extensibility.I DTExtensibility 2.OnConnection
applicationObje ct = application
addInInstance = addInInst
' If you aren't in startup, manually call OnStartupComple te.
If (connectMode <> Extensibility.e xt_ConnectMode. ext_cm_Startup)
Then _
Call OnStartupComple te(custom)
End Sub
#End Region
Public Function Tester()
MsgBox("testing 1 2 3")
End Function
End Class
i got a COM add-in and it loads fine in to outlook but if i add the
following line of code so that i can call a function from an outlook form it
doesn't load at all?
application.COM AddIns.Item("DM CRM.Connect").O bject = Me
i got this info from http://support.microsoft.com/?kbid=240768
My code is below and the function i am trying to call is tester
thanks a lot any help please
Jonathan
Imports Microsoft.Offic e.Core
Imports Microsoft.Offic e.Interop.Outlo ok
Imports Extensibility
Imports System.Runtime. InteropServices
#Region " Read me for Add-in installation and setup information. "
' When run, the Add-in wizard prepared the registry for the Add-in.
' At a later time, if the Add-in becomes unavailable for reasons such as:
' 1) You moved this project to a computer other than which is was
originally created on.
' 2) You chose 'Yes' when presented with a message asking if you wish to
remove the Add-in.
' 3) Registry corruption.
' you will need to re-register the Add-in by building the DMCRMSetup project
' by right clicking the project in the Solution Explorer, then choosing
install.
#End Region
<GuidAttribute( "572C0332-5D4C-4BF3-B8E4-943F860399B8"),
ProgIdAttribute ("DMCRM.Connect ")> _
Public Class Connect
#Region "Var"
Implements Extensibility.I DTExtensibility 2
'
'
'
Dim applicationObje ct As Object
Dim addInInstance As Object
#End Region
#Region "COM add-in"
Public Sub OnBeginShutdown (ByRef custom As System.Array) Implements
Extensibility.I DTExtensibility 2.OnBeginShutdo wn
On Error Resume Next
' Notify the user you are shutting down, and delete the button.
MsgBox("Our custom Add-in is unloading.")
End Sub
Public Sub OnAddInsUpdate( ByRef custom As System.Array) Implements
Extensibility.I DTExtensibility 2.OnAddInsUpdat e
'
End Sub
Public Sub OnStartupComple te(ByRef custom As System.Array) Implements
Extensibility.I DTExtensibility 2.OnStartupComp lete
MsgBox("Our custom Add-in is loading.")
End Sub
Public Sub OnDisconnection (ByVal RemoveMode As
Extensibility.e xt_DisconnectMo de, ByRef custom As System.Array) Implements
Extensibility.I DTExtensibility 2.OnDisconnecti on
On Error Resume Next
If RemoveMode <>
Extensibility.e xt_DisconnectMo de.ext_dm_HostS hutdown Then _
Call OnBeginShutdown (custom)
applicationObje ct = Nothing
End Sub
Public Sub OnConnection(By Val application As Object, ByVal connectMode
As Extensibility.e xt_ConnectMode, ByVal addInInst As Object, ByRef custom As
System.Array) Implements Extensibility.I DTExtensibility 2.OnConnection
applicationObje ct = application
addInInstance = addInInst
' If you aren't in startup, manually call OnStartupComple te.
If (connectMode <> Extensibility.e xt_ConnectMode. ext_cm_Startup)
Then _
Call OnStartupComple te(custom)
End Sub
#End Region
Public Function Tester()
MsgBox("testing 1 2 3")
End Function
End Class
Comment