Notice: This website is an unofficial Microsoft Knowledge Base (hereinafter KB) archive and is intended to provide a reliable access to deleted content from Microsoft KB. All KB articles are owned by Microsoft Corporation. Read full disclaimer for more details.

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


View products that this article applies to.

This article was previously published under Q243387

↑ Back to the top


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"

↑ Back to the top


Cause

EventDetails.MessageID returns the EntryID of a Message object instead of an AppointmentItem object.

↑ Back to the top


Status

This behavior is by design.

↑ Back to the top


More information

Steps to Reproduce Behavior

  1. 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>
    						
  2. 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>
    						
  3. 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>
    						
  4. 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>
    						
  5. 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>
    						
  6. 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>
    						

↑ Back to the top


Keywords: KB243387, kbprb, kbmsg

↑ Back to the top

Article Info
Article ID : 243387
Revision : 4
Created on : 3/4/2004
Published on : 3/4/2004
Exists online : False
Views : 485