I am using Outlook 2000. I was trying to write an
Outlook VBA subroutine to delete items in the Spam
folder based on the spam score of the messages in the
folder. However, while debugging I discovered that the
messages that SpamBayes had filtered and moved into
the Spam folder did not have a spam score. In VBA
terms, this meant the "UserProperties collection" had no
members. However, if I exit outlook without
moving/training with the affected messages, then when
I come back the messages have a spam score of zero.
In VBA terms, the "UserProperties collection" now has
one item, a Percent field named Spam. The value of this
UserProperty is zero however. If I run the "Spam
clues..." option on this mail it is nonzero and normally
spam-qualified (over the default 90% setting which I
have retained).
Speculating, SpamBayes acts as if the spam score is
volatile and managed completely by SpamBayes based
on Outlook events, until Outlook exit when the score is
saved?
Logged In: YES
user_id=14198
I'm afraid this is not a bug. We intentionally do not set
the Spam score via "UserProperties". We *do* touch the
UserProperties collection for a single message per folder
when we startup, as this allows the "Spam" score to show in
the Outlook UI. This is probably what you saw. However, as
each message is scored, we do not touch UserProperties, but
instead set everything directly via MAPI.
To be honest, I'm not sure how to get the spam value using
the Outlook object model. It is easy via CDO - you just use
the Fields collection on the object. I would be very
surprised if Outlook can't get at this field somehow. Try
and find information on how to get at any "raw" MAPI field,
and you should be right. If you get stuck, drop me an email.
Logged In: YES
user_id=14198
Actually, to be clear, you did raise 2 issues. One is that
you can't get at the field via VBA, which is what I
addressed. The other is that in some cases, exiting Outlook
can reset a spam field to zero - this is a bug that has
since been fixed, so the next version will not do this (but
the next version will have the same VBA issues)