- Subject: Re: Help writing a macro to move emails
- Author: landau@skiz.net
- Date: 07 Feb 2008
- References:
1
2
3
4
5
Sorry.... I know that was wrong... but I'm stumped.
In Class called "EdClass"
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
Dim myClass As New EdClass
Sub Register_Event2_Handler()
Set myClass.myOlInspectors = Application.Inspectors 'gives me an
error.
End Sub
From the immediate window, I tried calling: myClass.Initialize_handler
and that gave me the same error.
HELP :)
Thanks
-Ed