clsexplorerwrapper.cls

来自「Outlook Inspector Explorer Trap Events C」· CLS 代码 · 共 69 行

CLS
69
字号
VERSION 1.0 CLASS
BEGIN
  MultiUse = -1  'True
  Persistable = 0  'NotPersistable
  DataBindingBehavior = 0  'vbNone
  DataSourceBehavior  = 0  'vbNone
  MTSTransactionMode  = 0  'NotAnMTSObject
END
Attribute VB_Name = "clsExplorerWrapper"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = True
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = True
'*********************************************************************
' copyright 2002 by Martin Nemzow (mnemzow@networkperf.com)
' You can use this code freely and distribute it.
' No warrantee granted or implied.
' this is a very loose modification of Randy Byrne's CBITEMS OUTLOOK
' COM Add-In in order to trap inspector events along side explorer events
' and watch the sequence of the events. The debugger works with it.
'
'... yes you can use this to add CommandBar items. But note that I have
' changed some variable names and added new classes with longer names
' so that it cuold be debugged and make some sense for reading to me.
' You are welcome to correct anything you want and tell me.
' the comments with '[2002] remove functionality available only in
' OUTLOOK 2002 and in OUTLOOK 2000. I appreciate everyone's efforts to
' decode how to automate Outlook, so if you have comments and changes
' I would very much appreciate it, and I think others will too.
'*********************************************************************
Option Explicit
'**********************************************
 'Class: clsExplorerWrapper
 '**********************************************
Private gBaseExplorerClass As New clsOutlookExplorerEvents
Private WithEvents m_objExplorer As Outlook.Explorer
Attribute m_objExplorer.VB_VarHelpID = -1
Private m_nID As Integer
Private Sub Class_Initialize()
    Set m_objExplorer = Nothing
End Sub
Private Sub Class_Terminate()
    Set m_objExplorer = Nothing
End Sub
Public Property Let Explorer(objExplorerl As Outlook.Explorer)
     Set m_objExplorer = objExplorerl
End Property
Public Property Get Explorer() As Outlook.Explorer
     Set Explorer = m_objExplorer
End Property
Public Property Let Key(ID As Integer)
     m_nID = ID
End Property
Private Sub m_objExplorer_Activate()
     On Error Resume Next
     MsgBox m_objExplorer.Caption & " was activated."
End Sub
Private Sub m_objExplorer_Close()
     On Error Resume Next
     moduleOutlookExplorer.KillExplorer m_nID, Me
     MsgBox m_objExplorer.Caption & " was closed."
     Set m_objExplorer = Nothing
     If gbl_objApplication.Explorers.Count <= 1 Then
         gBaseExplorerClass.UnInitHandler
     Else       'workaround chek
        MsgBox "Explorer objects still remain in memory and will keep Outlook in memory."
     End If
End Sub

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?