C
Creating Outlook appointment
The following code defaults to creating an appointment in my own calendar.
Now, I'd like to send an appointment to another person's calendar in Outlook
from my Access database. What additional codes do I need to make this work ?
Set objOutlook = CreateObject("Outlook.Application")
Set objAppt = objOutlook.CreateItem(olAppointmentItem)
With objAppt
.Start = Forms!frmAddToCalendar!ApptDate & " " &
Forms!frmAddToCalendar!ApptTime
.Duration = Forms!frmAddToCalendar!ApptLength
.Subject = Forms!frmAddToCalendar!Appt
.Body = Forms!frmAddToCalendar!ApptNotes
.Location = Forms!frmAddToCalendar!ApptLocation
If Forms!frmAddToCalendar!ApptReminder Then
.ReminderMinutesBeforeStart =
Forms!frmAddToCalendar!ReminderMinutes
.ReminderSet = True
End If
.Save
.Close (olSave)
End With
'Release the AppointmentItem object variable.
Set objAppt = Nothing
End If
'Release the Outlook object variable.
Set objOutlook = Nothing
'Set the AddedToOutlook flag, save the record, display a message.
Forms!frmAddToCalendar!AddedToOutlook = True
DoCmd.RunCommand acCmdSaveRecord
MsgBox "Appointment Added!"
Now, I'd like to send an appointment to another person's calendar in Outlook
from my Access database. What additional codes do I need to make this work ?
Set objOutlook = CreateObject("Outlook.Application")
Set objAppt = objOutlook.CreateItem(olAppointmentItem)
With objAppt
.Start = Forms!frmAddToCalendar!ApptDate & " " &
Forms!frmAddToCalendar!ApptTime
.Duration = Forms!frmAddToCalendar!ApptLength
.Subject = Forms!frmAddToCalendar!Appt
.Body = Forms!frmAddToCalendar!ApptNotes
.Location = Forms!frmAddToCalendar!ApptLocation
If Forms!frmAddToCalendar!ApptReminder Then
.ReminderMinutesBeforeStart =
Forms!frmAddToCalendar!ReminderMinutes
.ReminderSet = True
End If
.Save
.Close (olSave)
End With
'Release the AppointmentItem object variable.
Set objAppt = Nothing
End If
'Release the Outlook object variable.
Set objOutlook = Nothing
'Set the AddedToOutlook flag, save the record, display a message.
Forms!frmAddToCalendar!AddedToOutlook = True
DoCmd.RunCommand acCmdSaveRecord
MsgBox "Appointment Added!"