J
johan
I have a VB6 COM addin that runs in Outlook 2003. It works perfect on
some machines, but the MailItem_Open event wont fire on other machines.
The addin show check when the user creates a new email and instead of
showing an empty email a dialogbox should appear where the user can
choose a mail template. Everything works just fine, on must machines.
The following events works everywhere:
AddinInstance_OnConnection
oInspectors_NewInspector
oInspector_Activate
But the oMail_Open event dont fire on some machines. All machines have
Office 2003 SP2.
Here is the code:
Option Explicit
Private WithEvents oApp As Outlook.Application
Private WithEvents oInspectors As Outlook.Inspectors
Private WithEvents oInspector As Outlook.Inspector
Private WithEvents oMail As Outlook.MailItem
Private Sub AddinInstance_OnConnection(ByVal Application As Object,
ByVal ConnectMode As AddInDesignerObjects.ext_ConnectMode, ByVal
AddInInst As Object, custom() As Variant)
Globals.ManualMode = False
Set oApp = Application
Set oInspectors = oApp.Inspectors
End Sub
Private Sub AddinInstance_OnDisconnection(ByVal RemoveMode As
AddInDesignerObjects.ext_DisconnectMode, custom() As Variant)
Set oMail = Nothing
Set oInspector = Nothing
Set oInspectors = Nothing
Set oApp = Nothing
End Sub
Private Sub oInspector_Activate()
If TypeName(oInspector.CurrentItem) = "MailItem" Then
Set oMail = oInspector.CurrentItem
Else
Set oMail = Nothing
End If
End Sub
Private Sub oInspectors_NewInspector(ByVal Inspector As Inspector)
Set oInspector = Inspector
End Sub
Private Sub oMail_Open(Cancel As Boolean)
MsgBox "Will it fire?"
If oMail.EntryID <> "" Or oMail.ConversationIndex <> "" Then
Exit Sub
End If
If Not Globals.ManualMode Then
Cancel = True
Load frmTemplates
frmTemplates.Show
End If
Globals.ManualMode = False
End Sub
Please help!
// Johan
some machines, but the MailItem_Open event wont fire on other machines.
The addin show check when the user creates a new email and instead of
showing an empty email a dialogbox should appear where the user can
choose a mail template. Everything works just fine, on must machines.
The following events works everywhere:
AddinInstance_OnConnection
oInspectors_NewInspector
oInspector_Activate
But the oMail_Open event dont fire on some machines. All machines have
Office 2003 SP2.
Here is the code:
Option Explicit
Private WithEvents oApp As Outlook.Application
Private WithEvents oInspectors As Outlook.Inspectors
Private WithEvents oInspector As Outlook.Inspector
Private WithEvents oMail As Outlook.MailItem
Private Sub AddinInstance_OnConnection(ByVal Application As Object,
ByVal ConnectMode As AddInDesignerObjects.ext_ConnectMode, ByVal
AddInInst As Object, custom() As Variant)
Globals.ManualMode = False
Set oApp = Application
Set oInspectors = oApp.Inspectors
End Sub
Private Sub AddinInstance_OnDisconnection(ByVal RemoveMode As
AddInDesignerObjects.ext_DisconnectMode, custom() As Variant)
Set oMail = Nothing
Set oInspector = Nothing
Set oInspectors = Nothing
Set oApp = Nothing
End Sub
Private Sub oInspector_Activate()
If TypeName(oInspector.CurrentItem) = "MailItem" Then
Set oMail = oInspector.CurrentItem
Else
Set oMail = Nothing
End If
End Sub
Private Sub oInspectors_NewInspector(ByVal Inspector As Inspector)
Set oInspector = Inspector
End Sub
Private Sub oMail_Open(Cancel As Boolean)
MsgBox "Will it fire?"
If oMail.EntryID <> "" Or oMail.ConversationIndex <> "" Then
Exit Sub
End If
If Not Globals.ManualMode Then
Cancel = True
Load frmTemplates
frmTemplates.Show
End If
Globals.ManualMode = False
End Sub
Please help!
// Johan