Outlook Calendar

  • Thread starter Thread starter Julie
  • Start date Start date
J

Julie

Hi,

Hope someone can help, I have found the following code,
which works great, in that it adds an appointment to
Outlook Calendar. I wish to enhance this code, so it
checks whether there is already an appointment at this
time, and exit the subprocedure if there is. (With an
appropriate message and (if possible) check the next
available time.

If anyone can give me any clues, that would be great:

**********************
Public Sub OutlookAppt()
Dim objOutlook As Outlook.Application
Dim apptOutlook As Outlook.AppointmentItem
Set objOutlook = CreateObject("Outlook.Application")
Set apptOutlook = objOutlook.CreateItem
(olAppointmentItem)
With apptOutlook
'Set date and time of the appointment
.Start = Date & " 5:00 pm"

'Set length of appointment in minutes
.Duration = 60

'Set Subject, Body, and Location of the appointment
.Subject = "Sales Meeting"
.Body = "This is a Booking." _
& vbCrLf & "Please be on time."
.Location = "Conference Room 1"

'Set the attendees which must attend
.RequiredAttendees = "Nancy Davolio;Andrew Fuller"


'Set reminder for 10 minutes before appointment
.ReminderMinutesBeforeStart = 10
.ReminderSet = True
.Save
End With


Set apptOutlook = Nothing
Set objOutlook = Nothing
End Sub
***********************

Thanks again

Julie
 
Hi Julie,

Sorry for the delay in responding to this.

Outlook has a system for chcking "free time" when making appointments
and as far as I know this is accessible through the Outlook object model
that your code is using. The best place I know to look for informatoin
about this sort of thing is at www.slipstick.com
 
Back
Top