• 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
06 Feb 2008Help writing a macro to move emails.landau@skiz.net
06 Feb 2008|- RE: Help writing a macro to move emails.Anand.V.V.N
22 Jan 2010|  \ imap move deleted email to TRASH in outlook.andre cloete
06 Feb 2008\ Re: Help writing a macro to move emails.Ken Slovak - [MVP - O...
06 Feb 2008   \ Re: Help writing a macro to move emails.landau@skiz.net
06 Feb 2008      \ Re: Help writing a macro to move emails.Ken Slovak - [MVP - O...
06 Feb 2008         \ Re: Help writing a macro to move emails.landau@skiz.net
07 Feb 2008            |- Re: Help writing a macro to move emails.landau@skiz.net
07 Feb 2008            \ Re: Help writing a macro to move emails.Ken Slovak - [MVP - O...
07 Feb 2008               \ Re: Help writing a macro to move emails.landau@skiz.net
07 Feb 2008                  \ Re: Help writing a macro to move emails.Ken Slovak - [MVP - O...
13 Mar 2008                     \ Re: Help writing a macro to move emails.sandeepthanki@gmail.com
Contact Us
All times are in (US) Eastern Daylight Time (GMT -4:00)