A Microsoft Outlook email forum. Outlook Banter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Outlook and VBA
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

AppointmentItem question (2003)



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old January 18th 06, 05: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
  #2  
Old January 18th 06, 06:13 PM posted to microsoft.public.outlook.program_vba
Dana DeLouis
external usenet poster
 
Posts: 6
Default AppointmentItem question (2003)

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.

--
Dana
Win XP & Office 2003


"Dana DeLouis" wrote in message
...
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




 




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Outlook 2003 GPO question Courtney R Outlook - Installation 1 March 4th 06 11:12 PM
Screen resolution change in outlook 2003 text size question Andym Outlook - Installation 2 March 2nd 06 07:17 PM
Stupid question SgtRich Outlook - General Queries 1 February 11th 06 08:12 PM
Question Jeremiah Outlook - General Queries 3 January 31st 06 02:33 AM
SBS 2003 exchange question - Outlook problem dimon Outlook - General Queries 1 January 11th 06 05:11 AM


All times are GMT +1. The time now is 08:51 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2025 Outlook Banter.
The comments are property of their posters.