Hi,
I am writing an exchange 2000 event sink in vbscript. What I need to do is assign a certain Outlook category to every incoming message. So I tried registering "onsave" eventsink and attaching a test script. It works, I can e.g. add some text to the body of each incoming message.
But for some reason I cannot access Categories property of the message object.
My code is this:
'------------------------------------------------------
<SCRIPT LANGUAGE="VBScript">
Sub ExStoreEvents_OnSave(pEventInfo, bstrURLItem, lFlags)
Const EVT_NEW_ITEM = 1
Const EVT_IS_DELIVERED = 8
If (lFlags And EVT_IS_DELIVERED) Or (lFlags And EVT_NEW_ITEM) Then
On Error Resume Next
Dim msgobj
Set msgobj = CreateObject("CDO.Message")
msgobj.DataSource.Open bstrURLItem, ,3
arrCat = msgobj.Categories()
msgobj.TextBody = "Err.Number" & ": " & err.Number & vbCrLf & _
"Err.Description" & ": " & err.Description & vbCrLf
msgobj.Fields.Update
msgobj.DataSource.Save
Set msgobj = Nothing
End If
End Sub
</SCRIPT>
'------------------------------------------------------
So when I try to send a message to that mailbox I get it with the following text in the body:
Err.Number: 438
Err.Description: Object doesn't support this property or method
So it looks like there is no such Categories property for CDO message object. But here they say that it exists
http://msdn.microsoft.com/library/de...ge_object_.asp
So what could I be doing wrong?
Thanx in advance,
Gatis