Creating Calendar Items

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I would like to use a list of dates & events in excel to create corresponding
entries (appointments) in the outlook calendar .

Does anybody have some existing code that I can use to get started?

Thanks, Kaval
 
Hi Kaval,

a little sample:

Private Function CreateAppointment(ByVal dtStart As Date, _
sSubject As String _
) As Outlook.AppointmentItem
On Error GoTo ERR_HANDLER
Dim oAppointment As Outlook.AppointmentItem

Set oAppointment = Application.CreateItem(olAppointmentItem)

With oAppointment
.Start = dtStart
.Subject = sSubject
.Save
End With

Set CreateAppointment = oAppointment
Exit Function

ERR_HANDLER:
MsgBox Err.Description, vbExclamation
End Function

The AppointmentItem has more properties. Please take a look at the
Object Browser (F2), switch from <All Libraries> to <Outlook> and select
the AppointenItem in the left pane.
 
Back
Top