- Subject: Re: Help writing a macro to move emails
- Author: landau@skiz.net
- Date: 06 Feb 2008
- References:
1
2
Thanks. I've tried that. This is what I have:
In a Class Module call EdClass:
Public WithEvents myEdItem As Outlook.MailItem
Private Sub Class_Initialize()
Set myItem = Application.ActiveInspector.CurrentItem
End Sub
Private Sub myEdItem_Close(Cancel As Boolean)
If Not myItem.Saved Then
MsgBox " The item was closed."
End If
End Sub
Then in a standard Module, I have:
Dim myClass As New EdClass
Sub Register_Event_Handler()
Set myClass.myEdItem = "Outlook.mailitem"
End Sub
But I get an error that an Object is needed when trying to instantiate
the class (set myClass...).
Any thoughts?
Thanks
-Ed