PRB: Can't Get Appointment Properties With EventDetails.MessageID
ID: Q243387
|
The information in this article applies to:
-
Collaboration Data Objects (CDO), version 1.21
-
Microsoft Exchange Server, version 5.5
SYMPTOMS
When you install an event script on a Calendar folder to process appointments, AppointmentItem-specific properties such as Location, StartTime, and EndTime can not be retrieved. Attempting to do this results a VBScript runtime error:
'800a01b6' "Object doesn't support this property or method"
CAUSE
EventDetails.MessageID returns the EntryID of a Message object instead of an AppointmentItem object.
STATUS
This behavior is by design.
MORE INFORMATIONSteps to Reproduce Behavior
- Install the following script to the default Calendar folder of a
mailbox for the event "A new item is posted to this folder."
- Add a new appointment to the calendar folder to trigger the script.
- Check the Agent log for the results. Note that the oMsg.Class is three (for a Message object) rather than 26, for an AppointmentItem.
- Uncomment the line in the script to retrieve oMsg.Location.
- Add another new appointment to the calendar to trigger the script.
- Check the Agent log for the results. Note that a VBScript runtime error 800a01b6 occurs at oMsg.Location.
<SCRIPT RunAt=Server Language=VBScript>
Option Explicit
Dim g_bstrDebug ' Debug String
' DESCRIPTION: Fired when a new message is added to the folder
Public Sub Folder_OnMessageCreated
Dim oMsg
Dim CDOPR_ENTRYID
Call DebugAppend("Calendar -- Folder_OnMessageCreated", False)
Set oMsg = _
EventDetails.Session.GetMessage(EventDetails.MessageID, Null)
Call DebugAppend("MessageClass: " & oMsg.Class, False)
Call DebugAppend("MessageSubject: " & oMsg.Subject, False)
'Call DebugAppend("MessageLocation: " & oMsg.Location, False)
' Check for possible sys errors
Call DebugAppend("Error Detected: ", True)
Script.Response = g_bstrDebug
End Sub
'---------------------------------------------------------------------'
' Name: DebugAppend
' Area: Debug
' Desc: Simple Debugging Function
' Parm: String Text, Bool ErrorFlag
'---------------------------------------------------------------------'
Private Sub DebugAppend(bstrParm,boolErrChkFlag)
If boolErrChkFlag = True Then
If err.number <> 0 Then
g_bstrDebug = g_bstrDebug & bstrParm & "-" & _
cstr(err.number) & err.description & vbCrLf
err.clear
End If
Else
g_bstrDebug = g_bstrDebug & bstrParm & vbCrLf
End If
End Sub
</SCRIPT>
Additional query words:
Keywords : kbCDO kbCDO121 kbXchge550 kbMsg kbGrpMsg kbDSupport
Version : WINDOWS:1.21; winnt:5.5
Platform : WINDOWS winnt
Issue type : kbprb
|