I have a VBS script that runs behind an Outlook calendar using MS Exchange 5.5 with SP4 and all CDO updates....Also using Outlook XP...I recieve this error message in the agent logs indicating a logon failure. The script will not execute at all, the following is the code snippet.
Thank you in advance....T
********************************************************
<SCRIPT RunAt=Server Language=VBScript>
'------------------------------------------------------------------------------
'FILE DESCRIPTION: Exchange Server Event Script
'------------------------------------------------------------------------------
Option Explicit
'------------------------------------------------------------------------------
' Global Variables
'------------------------------------------------------------------------------
'------------------------------------------------------------------------------
' Event Handlers
'------------------------------------------------------------------------------
' DESCRIPTION: This event is fired when a new message is added to the folder
Public Sub Folder_OnMessageCreated
Dim objCDO
Dim objMessage
Dim objOfficeCalendar
' Get session
Set objCDO = EventDetails.Session
' Get current Message
Set objMessage=
objCDO.GetMessage(EventDetails.MessageID, Null)
' Instance VB Component
Set objOfficeCalendar = CreateObject("OfficeCalendarDLL.OfficeCalendar"
' Call AddItem method of VB Component and pass the Message objects
'The error occurs on this line ********
objOfficeCalendar.AddItem objMessage
' Destroy all object variables
Set objMessage = Nothing
Set objOfficeCalendar = Nothing
Set objCDO = Nothing
End Sub
' DESCRIPTION: This event is fired when a message in the folder is changed
Public Sub Message_OnChange
'Script.Response = Now & " - Create: " & objMessage.TimeCreated & " - Mod: " & 'objMessage.TimeLastModified
Dim objCDO
Dim objMessage
Dim objOfficeCalendar
' Get session
Set objCDO = EventDetails.Session
' Get current Message
Set objMessage = objCDO.GetMessage(EventDetails.MessageID, Null)
' Since the VB component adds the unique ID when the new item is added, the
' change event fires. To prevent this, if the time the message was created
' is within 30 seconds of the time it was last modified, the VB component is
' not called.
If DateDiff("s", objMessage.TimeCreated, objMessage.TimeLastModified) > 30 Then
' Instance VB Component
Set objOfficeCalendar = CreateObject("OfficeCalendarDLL.OfficeCalendar"
' Call DeleteItem method of VB Component and pass message object
objOfficeCalendar.ChangedItem(objMessage)
Else
' Do Nothing
End If
' Destroy all object variables
Set objMessage = Nothing
Set objOfficeCalendar = Nothing
Set objCDO = Nothing
End Sub
' DESCRIPTION: This event is fired when a message is deleted from the folder
Public Sub Folder_OnMessageDeleted
' Do not put code here to trap for a deleted item on a personal calendar.
' By the time the delete event fires, the message object is gone. Therefore,
' there is no way to retrieve property values.
' See the code in the New event of the deleted items folder. When an item
' is deleted from the personal calendar, that code will run and delete the
' item from the office calendar.
End Sub
' DESCRIPTION: This event is fired when the timer on the folder expires
Public Sub Folder_OnTimer
End Sub
</SCRIPT>
Thank you in advance....T
********************************************************
<SCRIPT RunAt=Server Language=VBScript>
'------------------------------------------------------------------------------
'FILE DESCRIPTION: Exchange Server Event Script
'------------------------------------------------------------------------------
Option Explicit
'------------------------------------------------------------------------------
' Global Variables
'------------------------------------------------------------------------------
'------------------------------------------------------------------------------
' Event Handlers
'------------------------------------------------------------------------------
' DESCRIPTION: This event is fired when a new message is added to the folder
Public Sub Folder_OnMessageCreated
Dim objCDO
Dim objMessage
Dim objOfficeCalendar
' Get session
Set objCDO = EventDetails.Session
' Get current Message
Set objMessage=
objCDO.GetMessage(EventDetails.MessageID, Null)
' Instance VB Component
Set objOfficeCalendar = CreateObject("OfficeCalendarDLL.OfficeCalendar"
' Call AddItem method of VB Component and pass the Message objects
'The error occurs on this line ********
objOfficeCalendar.AddItem objMessage
' Destroy all object variables
Set objMessage = Nothing
Set objOfficeCalendar = Nothing
Set objCDO = Nothing
End Sub
' DESCRIPTION: This event is fired when a message in the folder is changed
Public Sub Message_OnChange
'Script.Response = Now & " - Create: " & objMessage.TimeCreated & " - Mod: " & 'objMessage.TimeLastModified
Dim objCDO
Dim objMessage
Dim objOfficeCalendar
' Get session
Set objCDO = EventDetails.Session
' Get current Message
Set objMessage = objCDO.GetMessage(EventDetails.MessageID, Null)
' Since the VB component adds the unique ID when the new item is added, the
' change event fires. To prevent this, if the time the message was created
' is within 30 seconds of the time it was last modified, the VB component is
' not called.
If DateDiff("s", objMessage.TimeCreated, objMessage.TimeLastModified) > 30 Then
' Instance VB Component
Set objOfficeCalendar = CreateObject("OfficeCalendarDLL.OfficeCalendar"
' Call DeleteItem method of VB Component and pass message object
objOfficeCalendar.ChangedItem(objMessage)
Else
' Do Nothing
End If
' Destroy all object variables
Set objMessage = Nothing
Set objOfficeCalendar = Nothing
Set objCDO = Nothing
End Sub
' DESCRIPTION: This event is fired when a message is deleted from the folder
Public Sub Folder_OnMessageDeleted
' Do not put code here to trap for a deleted item on a personal calendar.
' By the time the delete event fires, the message object is gone. Therefore,
' there is no way to retrieve property values.
' See the code in the New event of the deleted items folder. When an item
' is deleted from the personal calendar, that code will run and delete the
' item from the office calendar.
End Sub
' DESCRIPTION: This event is fired when the timer on the folder expires
Public Sub Folder_OnTimer
End Sub
</SCRIPT>