PC Review Forums Newsgroups Microsoft Outlook Microsoft Outlook VBA Programming This seems impossible: MessageClass is changing on me.

Reply

This seems impossible: MessageClass is changing on me.

 
Thread Tools Rate Thread
Old 18-02-2004, 01:39 AM   #1
Tom van Stiphout
Guest
 
Posts: n/a
Default This seems impossible: MessageClass is changing on me.


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=...3D100%26hl%3Den

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.


  Reply With Quote
Old 18-02-2004, 07:52 PM   #2
Tom van Stiphout
Guest
 
Posts: n/a
Default Re: This seems impossible: MessageClass is changing on me.

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

Item.MessageClass

use:

Item.FormDescription.MessageClass

-Tom.

<clip>




  Reply With Quote
Reply



Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off