G
George Hester
Here is a smippet of the code;
If obj.Class = olMail Then
MsgBox "Here"
Set myMail = obj
MsgBox myMail.Subject
Set usrProperty = myMail.UserProperties
MsgBox usrProperty.Count
Set oSpam = usrProperty.Find("MySpam")
'MsgBox IsError(oSpam.Name)
MsgBox IsObject(oSpam)
End If
This obj lies in a folder for which the MySpam field "exists in the folder."
What exactly that means I do not know but let's assume it does because I am
not getting the error "Field Unknown."
But in the statement Set oSpam = usrProperty.Find("MySpam") I am not getting
an error even when usrProperty.Count = 0. But the error comes in the
following statement MsgBox IsError(oSpam.Name) which is Object variable or
With block variable not set and Error number is H5B.
This presents a problem. What I need is some way to capture the situation
where "MySpam" has not been added to the UserProperties collection for a
specific MailItem and the way I tried it was to raise an error with
oSpam.Name but seems not to be capturable w/o a On Error Resume Next which I
do not want to use.. The next statement resolves to True. Any ideas?
If obj.Class = olMail Then
MsgBox "Here"
Set myMail = obj
MsgBox myMail.Subject
Set usrProperty = myMail.UserProperties
MsgBox usrProperty.Count
Set oSpam = usrProperty.Find("MySpam")
'MsgBox IsError(oSpam.Name)
MsgBox IsObject(oSpam)
End If
This obj lies in a folder for which the MySpam field "exists in the folder."
What exactly that means I do not know but let's assume it does because I am
not getting the error "Field Unknown."
But in the statement Set oSpam = usrProperty.Find("MySpam") I am not getting
an error even when usrProperty.Count = 0. But the error comes in the
following statement MsgBox IsError(oSpam.Name) which is Object variable or
With block variable not set and Error number is H5B.
This presents a problem. What I need is some way to capture the situation
where "MySpam" has not been added to the UserProperties collection for a
specific MailItem and the way I tried it was to raise an error with
oSpam.Name but seems not to be capturable w/o a On Error Resume Next which I
do not want to use.. The next statement resolves to True. Any ideas?