Importing Calendar Appointments programmatically

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

Guest

Could someone please show me or point me to a web site that has an example of
how to create an appointment in my Outlook XP calendar?
In my code I already have this information defined:
Location as String
Time as Varient
Start Date as Varient
Subject as String
Notes as String
Category as String

Can I create an appointment with this data?
thanks,
ck
 
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]
 
Thanks,
One more thing, what is the line of code that will set the remindertime to
no reminder?
thanks,
ck
 
Back
Top