View Single Post
  #1  
Old January 18th 06, 04:38 PM posted to microsoft.public.outlook.program_vba
Dana DeLouis
external usenet poster
 
Posts: 6
Default AppointmentItem question (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, 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

--
Dana


Ads