Importing Calendar Appointments programmatically
You'll want to wipe out the variable declarations and data assignments, but
the code below will create an appointment. You will most likely need to
change the line that says "Set appt = " to find the correct calendar folder
you want to add the appointment to. If you need further help, post back.
Dim appt As Outlook.AppointmentItem
Dim Location As String
Dim Time As Variant
Dim StartDate As Variant
Dim Subject As String
Dim Notes As String
Dim Category As String
Location = "Somewhere"
Subject = "My Subject"
Notes = "Some notes..."
StartDate = #1/31/2006#
Time = "1:05 pm"
Category = "Business, Competition, Favorites"
Set appt = Session.Folders.Item("Personal
Folders").Folders.Item("Calendar").Items.Add
appt.Location = Location
appt.Subject = Subject
appt.Body = Notes
appt.Start = Format$(StartDate, "mm/dd/yy") & " " & Format$(Time,
"hh:MM:ss am/pm")
appt.Categories = Category
appt.Save
Set appt = Nothing
Jay Taplin [MCP - VB]
|