Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Outlook / Programming VBA / January 2006

Tip: Looking for answers? Try searching our database.

AppointmentItem question (2003)

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Dana DeLouis - 18 Jan 2006 16:38 GMT
Hello.  I'm studying Outlook Programming for the first time (Sue Mosher's
book).  I was able to add an Appointment to the calender the other day, but
now it's not working.
Can anyone spot the why I'm getting an "'Application-defined" error.  I'm
running this from Excel, with a vba library reference set to Outlook 11.
Outlook 2003, IM only mode also.
Thanks for any insight.  I just don't see why it's not working now.  :>(

Sub Testing()
   Dim olApp As Outlook.Application
   Dim objMail As Outlook.MailItem
   Dim objAppt  As Outlook.AppointmentItem

   Set olApp = Outlook.Application

   'Application-defined or object-defined error
   Set objAppt = olApp.CreateItem(olAppointmentItem)

   'However, this is ok...
   Set objMail = olApp.CreateItem(olMailItem)
End Sub

Signature

Dana

Dana DeLouis - 18 Jan 2006 17:13 GMT
Well, I think I found the problem.  I just tried to add an new appointment
manually, and could not.  I couldn't add an appointment, or modify any
appointments in my Calendar.  Ahhh!
Some of the code must have corrupted the calendar.
Anyway, I rebooted the computer, and the sample code below works as
expected.
Something in my program must be corrupting the Calendar.
Anyway, thanks again.

Signature

Dana
Win XP & Office 2003

> Hello.  I'm studying Outlook Programming for the first time (Sue Mosher's
> book).  I was able to add an Appointment to the calender the other day,
[quoted text clipped - 17 lines]
>    Set objMail = olApp.CreateItem(olMailItem)
> End Sub
 
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.