A
Asa H
I have created an Outlook Add-in based on the ItemsCB example. My
problem is that the NewInspector event stop firing after a while.
Somtimes everything works fine for hours, sometimes only a few
minutes. Does some object go out of scope or what is happening?
I'm using Outlook 2002 sp-2 on Windows XP sp-1.
Thanks in advance!
Asa
This is part of my code:
--------------------------
--- Connect Module -------
--------------------------
Implements IDTExtensibility2
Private WithEvents mobjOutlook As Outlook.Application
Private WithEvents mcolInsp As Outlook.Inspectors
Private Sub IDTExtensibility2_OnConnection(ByVal Application As
Object, _
ByVal ConnectMode As AddInDesignerObjects.ext_ConnectMode, _
ByVal AddInInst As Object, custom() As Variant)
Set mobjOutlook = Application
If mobjOutlook.Explorers.Count > 0 Then
Set mcolInsp = mobjOutlook.Inspectors
gsProgID = AddInInst.ProgId
Else
Set mobjOutlook = Nothing
End If
End Sub
Private Sub mcolInsp_NewInspector(ByVal Inspector As
Outlook.Inspector)
If Inspector.CurrentItem.Class = olMail Then
AddInspector Inspector
End If
End Sub
--------------------------
--- End Connect Module ---
--------------------------
----------------------------------
--- Inspector Wrap Handler -------
----------------------------------
Public Sub AddInspector(vobjInsp As Outlook.Inspector)
Dim objInspWrap As InspWrap
Set objInspWrap = New InspWrap
With objInspWrap
.Inspector = vobjInsp
.CurrentMailItem = vobjInsp.CurrentItem
.Key = mnID
End With
gcolInspWrap.Add objInspWrap, "key" & CStr(mnID)
mnID = mnID + 1
Set objInspWrap = Nothing
End Sub
problem is that the NewInspector event stop firing after a while.
Somtimes everything works fine for hours, sometimes only a few
minutes. Does some object go out of scope or what is happening?
I'm using Outlook 2002 sp-2 on Windows XP sp-1.
Thanks in advance!
Asa
This is part of my code:
--------------------------
--- Connect Module -------
--------------------------
Implements IDTExtensibility2
Private WithEvents mobjOutlook As Outlook.Application
Private WithEvents mcolInsp As Outlook.Inspectors
Private Sub IDTExtensibility2_OnConnection(ByVal Application As
Object, _
ByVal ConnectMode As AddInDesignerObjects.ext_ConnectMode, _
ByVal AddInInst As Object, custom() As Variant)
Set mobjOutlook = Application
If mobjOutlook.Explorers.Count > 0 Then
Set mcolInsp = mobjOutlook.Inspectors
gsProgID = AddInInst.ProgId
Else
Set mobjOutlook = Nothing
End If
End Sub
Private Sub mcolInsp_NewInspector(ByVal Inspector As
Outlook.Inspector)
If Inspector.CurrentItem.Class = olMail Then
AddInspector Inspector
End If
End Sub
--------------------------
--- End Connect Module ---
--------------------------
----------------------------------
--- Inspector Wrap Handler -------
----------------------------------
Public Sub AddInspector(vobjInsp As Outlook.Inspector)
Dim objInspWrap As InspWrap
Set objInspWrap = New InspWrap
With objInspWrap
.Inspector = vobjInsp
.CurrentMailItem = vobjInsp.CurrentItem
.Key = mnID
End With
gcolInspWrap.Add objInspWrap, "key" & CStr(mnID)
mnID = mnID + 1
Set objInspWrap = Nothing
End Sub