Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsVB SyntaxEnterprise DevelopmentDatabase AccessControlsCOMWin APICrystal ReportDeploymentGeneralGeneral 2
Related Topics
VB.NET / ASP.NETMS SQL ServerMS AccessOther Database ProductsMore Topics ...

VB Forum / COM / December 2003



Tip: Looking for answers? Try searching our database.

Opening outlook error

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Eric Bouchard - 01 Aug 2003 14:48 GMT
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.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.