
How to create a Com AddIn for Outlook 2000 with VB6 standard
Hello,
I am trying to convert my
VBA Outlook Makros to an Com AddIn with Visual
Basic 6 standard.
I found some examples here in the newgroup and under
http://www.*-*-*.com/ and http://www.*-*-*.com/
But none of them has any effect on Outlook. Only if Outlook cannot find the
compiled DLL it complayins about it.
First, I had only a Designerfile: connect.dsr.
But when I select File build ... dll, VB says a form or a Main() is
necessary, so I added a Main-Routine.
May be the problem is, that under Project properties, I cannot select any
project type - it is fixed to standard-exe.
If have got the file connect.dsr with the following code:
Option Explicit
Implements IDTExtensibility2
' OnConnection - this is called by Outlook when the addin is first
connected(loaded).
'
Private Sub IDTExtensibility2_OnConnection(ByVal Application As Object,
ByVal _
ConnectMode As AddInDesignerObjects.ext_ConnectMode, ByVal AddInInst As
Object, _
custom() As Variant)
MsgBox "OnConnection"
End Sub
Private Sub IDTExtensibility2_OnAddInsUpdate(custom() As Variant)
'Nothing here
End Sub
Private Sub IDTExtensibility2_OnBeginShutdown(custom() As Variant)
On Error Resume Next
MsgBox "OnBeginShutdown"
End Sub
Private Sub IDTExtensibility2_OnDisconnection(ByVal RemoveMode As _
AddInDesignerObjects.ext_DisconnectMode, custom() As Variant)
MsgBox "OnDisconnection"
End Sub
Private Sub IDTExtensibility2_OnStartupComplete(custom() As Variant)
MsgBox "OnStartupComplete"
End Sub
Shouldn't then appear a message box, when I start Outlook. (The loadbehavior
is set 2 in the registry.)
thanks,
Christoph