I am running:
VB6
Outlook 98
Windows NT 4.0/windows 2000/winXP
I am trying to get some code that I got off of the
microsoft site to work. In my example, I click a button
and an appointment is placed in my calendar. the code
opens outlook and logs in and send the appointment.
When I run the code without logging in I have to choose my
profile. I need for it to do this on it's own. When I
put in the code, I get a runtime error:
Runtime error -2079063791 (84140111):
The Server is not availible. Contact your administrator
if this condition persists.
Code:
' Start Outlook.
Dim olApp As Outlook.Application
Set olApp = CreateObject("Outlook.Application")
' Logon.
Dim olNs As Outlook.NameSpace
Set olNs = olApp.GetNamespace("MAPI")
***************************************
THIS IS WHERE THE ERROR OCCURS
***************************************
olNs.Logon
^^^^^^^^^^
' Create a new appointment.
Dim olAppt As Outlook.AppointmentItem
Set olAppt = olApp.CreateItem(olAppointmentItem)
' Set start time for 2-minutes from now...
olAppt.Start = Now() + (2# / 24# / 60#)
' Setup other appointment information...
With olAppt
.Duration = 60
.Subject = "Meeting to discuss meetings..."
.Body = "Meeting with " ' & olItem.FullName & " to
discuss Meetings."
.Location = "Hell"
.ReminderMinutesBeforeStart = 1
.ReminderSet = True
End With
' Save Appointment...
olAppt.Save
' Clean up...
MsgBox "All done...", vbMsgBoxSetForeground
olNs.Logoff
Set olNs = Nothing
Set olAppt = Nothing
Set olApp = Nothing
Any Ideas? If you need more info let me know.
regards
Eric
Paresh Joshi - 30 Dec 2003 11:34 GMT
This article may help
171422 HOWTO: Logging on CDO (1.x) to Active Messaging Session with Default
http://support.microsoft.com/?id=171422
Paresh Joshi
UK Developer Support
This posting is provided "AS IS" with no warranties, and confers no rights.