Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Mapi_E_Logon_Failed

Status
Not open for further replies.

tavie

Technical User
Nov 23, 2001
79
US
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(&quot;OfficeCalendarDLL.OfficeCalendar&quot;)

' 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 & &quot; - Create: &quot; & objMessage.TimeCreated & &quot; - Mod: &quot; & '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(&quot;s&quot;, objMessage.TimeCreated, objMessage.TimeLastModified) > 30 Then

' Instance VB Component
Set objOfficeCalendar = CreateObject(&quot;OfficeCalendarDLL.OfficeCalendar&quot;)

' 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>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top