- Subject: Re: Help writing a macro to move emails
- Author: landau@skiz.net
- Date: 06 Feb 2008
- References:
1
2
3
4
'Hope I'm not pushing here :). So I'm taking small steps. I tried to
write something to test to see if the current inspector was mail (as
you suggested). I believe if I can get this down, the rest will be
easy. I guess I'm not grok;ing the class thing. I took a C++ class a
while back and was good at it. In this case, I'm not sure if the class
gets instantiated with the "Set" command... and if so, what is its
"handle" ?
Class:EdInspectorEventClass
Public WithEvents myOlInspectors As Outlook.Inspectors
Public Sub Initialize_handler()
Set myOlInspectors = Application.Inspectors
End Sub
Private Sub myOlInspectors_NewInspector(ByVal Inspector As
Outlook.Inspector)
If (Inspector.CurrentItem.Class = olMail) Then
MsgBox ("You're in mail.")
End If
End Sub
In Module2:
Sub DoSomething()
Set EdInspectorEventClass = Outlook.Inspectors
EdInspectorEventClass.Initialize_handler ' *****This is where
it fails and says object does not support this property.*****
End Sub