Scope of UserProperty in mail item

V

VBA question

Hello,
I try to mark any read mail by using the UserProperty as Ken Slovak
suggested. But I have problem to keep each mail item's UserProperty in the
application scope since after the function is called next time, the
UserProperty is reset. I tried to check the UserProperty exist first, if it
does not, add the new UserProperty, otherwise, do nothing. it is still not
working.the following is the short code.

Private Sub readMItem()
For Each mItem In inbox.Items
If (mItem.UserProperties.Item(1) Is Nothing) Then
Set myUserProperty = mItem.UserProperties.Add("isRead", olYesNo)
End If
............
next

end sub

The function readMItem is called every 10 seconds. How do I make the
UserProperty scope of each mail item in the running life of application not
only in the function.

Your help is greatly appreciated.

Regards
Shu
 

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