Outlook Banter

Outlook Banter (http://www.outlookbanter.com/)
-   Outlook and VBA (http://www.outlookbanter.com/outlook-vba/)
-   -   Importing Calendar Appointments programmatically (http://www.outlookbanter.com/outlook-vba/7344-importing-calendar-appointments-programmatically.html)

Charlie January 30th 06 05:21 PM

Importing Calendar Appointments programmatically
 
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

Jay Taplin January 30th 06 08:20 PM

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]



Charlie January 31st 06 04:16 PM

Importing Calendar Appointments programmatically
 
Thanks,
One more thing, what is the line of code that will set the remindertime to
no reminder?
thanks,
ck

Jay Taplin January 31st 06 06:41 PM

Importing Calendar Appointments programmatically
 
Just add this line:

appt.ReminderSet = False

Jay Taplin [MCP - VB]

"Charlie" wrote in message
...
Thanks,
One more thing, what is the line of code that will set the remindertime to
no reminder?
thanks,
ck





All times are GMT +1. The time now is 05:30 AM.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2006 OutlookBanter.com