Adding Appointment to Outlook Public Folder -
08-19-2005
, 06:09 PM
Hello,
I have basic code to Creat an Outlook appointment and add Access Data.
(code below)
This works to add appointments to the basic calendar in my user folder.
However I wish to add it to a Calendar that resides in Public folder.
Any advice or resources on how to do this?
The "address" is .... Public Folders...All Public
Folders...CommonRanchCalendar
And...if I can push my luck a little further.
How can I read/delete appointments in the same calendar through code.
I would want to limit what I delete to entries of a certain Category
(ie. "AccessAdded") although they will also have other categories
assigned to them.
Thanks in Advance for any help or pointers.
Mal.
=====
Existing Code to add basic Appointment.
Private Sub SndToOutlook_Click()
On Error GoTo Add_Err
'Add a new appointment.
Dim objOutlook As Outlook.Application
Dim objAppt As Outlook.AppointmentItem
Dim objRecurPattern As Outlook.RecurrencePattern
Set objOutlook = CreateObject("Outlook.Application")
Set objAppt = objOutlook.CreateItem(olAppointmentItem)
With objAppt
.Start = Me!ApptDate
.End = Me!ApptEnd
.AllDayEvent = True
.Subject = Me!ApptName
.Categories = "Retreat Groups" 'Check GroupID for CHR and
also add "Sponsored Retreat"
.Save
.Close (olSave)
End With
'Release the AppointmentItem object variable.
Set objAppt = Nothing
'Release the Outlook object variable.
Set objOutlook = Nothing
'Set the AddedToOutlook flag, save the record, display a message.
DoCmd.RunCommand acCmdSaveRecord
MsgBox "Appointment Added!"
Exit Sub |