Microsoft KB Archive/243387

= PRB: Can't Get Appointment Properties With EventDetails.MessageID =

Article ID: 243387

Article Last Modified on 3/4/2004

-

APPLIES TO


 * Microsoft Collaboration Data Objects 1.2
 * Microsoft Collaboration Data Objects 1.21
 * Microsoft Exchange Server 5.5 Standard Edition

-



This article was previously published under Q243387



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.



Steps 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.  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

   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.  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

   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.  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> </li>  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> </li>  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> </li>  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> </li></ol>

Keywords: kbmsg kbprb KB243387

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.