PC Review


Reply
Thread Tools Rate Thread

ASP CDO calendering works only if Outlook is open. Any Ideas? Code Attached.

 
 
Aaron
Guest
Posts: n/a
 
      30th Jun 2003
ASP code attempts to create an appointment in the logged on user's calendar.
All usernames and Exchange 5.5 aliases are equal. If outlook is open on the
client and the code is executed, an appointment is added for that user.
However, if Outlook is not running and we attempt to add a calendar
appointment, nothing happens and I do not get any error messages. Any ideas
would be appreciated.

Thanks,
Aaron

-------CODE------

Dim objSession
Dim objCalFold
Dim colAppts
Dim objNewAppt
Dim colRecips
Dim LogonUser
Dim objFolder
Dim pos

LogonUser = Request.ServerVariables("LOGON_USER")

pos = InStr(LogonUser, "\")
If pos > 0 Then
LogonUser = Mid(LogonUser, pos + 1)
Else
Response.write ("<p><b>Invalid user logon. Cannot perform
operation.</b><p>")
Exit Sub
End If

Set objSession = CreateObject("MAPI.Session")

If objSession Is Nothing Then
Response.write ("<p><b>Cannot establish MAPI session.</b><p>")
Exit Sub
End If


objSession.Logon "", "", False, True, 0, True, "proliant" & vbLf &
LogonUser

On Error Resume Next
Set objFolder = objSession.InBox

if objFOlder is Nothing then
Response.write ("<p><b>Cannot Logon.</b><p>")
Exit Sub
end if

Set objCalFold = objSession.GetDefaultFolder(0)
Set colAppts = objCalFold.Messages
Set objNewAppt = colAppts.Add

objNewAppt.Location = ""
objNewAppt.Subject = subject
objNewAppt.Text = Text
objNewAppt.StartTime = StartTime
objNewAppt.EndTime = StartTime

objNewAppt.Update True, True

objSession.Logoff

Set colRecips = Nothing
Set objNewAppt = Nothing
Set colAppts = Nothing
Set objCalFold = Nothing
Set objSession = Nothing

end sub



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
outlook will not open. says can't open folders. Any ideas? =?Utf-8?B?a2VsZnM=?= Microsoft Outlook Discussion 0 28th Mar 2007 01:06 AM
My query works, but won't open in design view - any ideas? =?Utf-8?B?TWlsbGVubml1bSBIZXJk?= Microsoft Access Queries 6 18th Oct 2005 05:34 PM
calendering with outlook 97 bobbie Microsoft Outlook Calendar 1 23rd Oct 2003 04:26 AM
Outlook Calendering Bridget Microsoft Outlook Calendar 2 1st Aug 2003 02:58 PM
ASP CDO Code only works with Outlook open. Aaron Microsoft Outlook VBA Programming 0 1st Jul 2003 04:32 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 11:16 AM.