This seems impossible: MessageClass is changing on me.

T

Tom van Stiphout

Hi All,
Environment: VB6 SP5, Outlook 2000 SP3, Windows 2000 SP4
I'm listening for items being added to the Deleted Items folder, along the
lines of:
http://groups.google.com/groups?hl=...e=UTF-8&as_ugroup=*outlook*&lr=&num=100&hl=en

Here is the relevant code:
Private Sub m_olDeletedItems_ItemAdd(ByVal Item As Object)

If m_bDeleteDetected And Item.MessageClass = "IPM.Appointment.SW" Then
' Do my special thing with this custom form
MsgBox "Taking the If clause"

m_bDeleteDetected = False
Else
Debug.Print Item.MessageClass, m_bDeleteDetected
Stop
End If
End Sub

The behavior I see is that if I'm deleting an appointment of this custom
message class (I verified the IPM.Appointment.SW message class using
OutlookSpy),

often my code will not take the If clause, but the Else clause, and it will
debug.print:
IPM.Note True

If then in the Immediate window I enter:
?Item.MessageClass, m_bDeleteDetected
I will get:
IPM.Appointment.SW True

That doesn't make sense to me. It seems that the messageclass is not
constant.
Who can clarify it for me?

Thanks,

-Tom.
 
T

Tom van Stiphout

I found out how to fix this. Rather than using:

Item.MessageClass

use:

Item.FormDescription.MessageClass

-Tom.

<clip>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top