Welcome to the Excel Forum

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.

Please Register to Remove these Ads

Please Register to Remove these Ads



Reply
  #1  
Old 06-19-2009, 04:12 PM
timbim timbim is offline
Registered User
 
Join Date: 24 Feb 2008
Location: Tonbridge/Brighton, England
MS Office Version:2007
Posts: 26
timbim is becoming part of the community
Adding appointments

Please Register to Remove these Ads

I'm trying to write a sub to automatically add appointments to my calendar. I've got this from the help file, which compiles but does not appear on my calendar (I'm using an exchange connection but have only one calendar) Can someone tell me what I'm doing wrong?

Code:
Sub AddBreakfast()

Dim myOlApp As New Outlook.Application
Dim myItem As Outlook.AppointmentItem
    
Set myItem = myOlApp.CreateItem(olAppointmentItem)

With myItem
    .Subject = "Breakfast"
    .Location = "Manor"
    .Start = #6/20/2009 7:50:00 AM#
    .Duration = 20
End With

End Sub

Last edited by timbim; 06-19-2009 at 04:18 PM.
Reply With Quote
  #2  
Old 06-19-2009, 04:17 PM
DonkeyOte's Avatar
DonkeyOte DonkeyOte is offline
Forum Guru
 
Join Date: 22 Oct 2008
Location: Suffolk, UK
MS Office Version:2002 & 2007
Posts: 13,548
DonkeyOte has a reputation beyond repute DonkeyOte has a reputation beyond repute DonkeyOte has a reputation beyond repute DonkeyOte has a reputation beyond repute DonkeyOte has a reputation beyond repute DonkeyOte has a reputation beyond repute DonkeyOte has a reputation beyond repute DonkeyOte has a reputation beyond repute DonkeyOte has a reputation beyond repute DonkeyOte has a reputation beyond repute DonkeyOte has a reputation beyond repute
Re: Adding appointments

You need to add

Code:
.Save
prior to End With
Reply With Quote
  #3  
Old 06-19-2009, 04:18 PM
timbim timbim is offline
Registered User
 
Join Date: 24 Feb 2008
Location: Tonbridge/Brighton, England
MS Office Version:2007
Posts: 26
timbim is becoming part of the community
Re: Adding appointments

Thank you!
Reply With Quote


Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes Rate This Thread
Rate This Thread:

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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

Forum Jump