rtdc
Registered User.
- Local time
- Today, 15:01
- Joined
- Feb 27, 2007
- Messages
- 55
I have been asked if I can place an appointment reminder in a specific calendar within outlook, I have been placing appointments in outlook for years using code like this
Dim objOutlook As Outlook.Application
Dim objAppt As Outlook.AppointmentItem
Dim objRecurPattern As Outlook.RecurrencePattern
Dim dayz As Long, N As String, SID As String
N = Forms![OutlookReminder_frm]![Name_Field]
SID = Forms![OutlookReminder_frm]![StudentID]
Dim total As Long
Set objOutlook = CreateObject("Outlook.Application")
Set objAppt = objOutlook.CreateItem(olAppointmentItem)
With objAppt
.Start = Forms![OutlookReminder_frm]![TxtDate] & " " & Forms![OutlookReminder_frm]![TxtTime] 'change this to Date and time - mine is from a combo boxes
.Subject = SID & " " & N & " " & Forms![OutlookReminder_frm]![TxtSubject]
.Duration = Forms![OutlookReminder_frm]![TxtDuration]
.ReminderSet = True
.ReminderMinutesBeforeStart = Forms![OutlookReminder_frm]![TxtReminder]
.Body = Nz(Forms![OutlookReminder_frm]![TxtBody], " ")
.Importance = olImportanceHigh
.Save
.Close (olSave)
End With
'Release the AppointmentItem object variable.
Set objAppt = Nothing
'Release the Outlook object variable.
Set objOutlook = Nothing
It seems this code just puts it in the default calendar but the user has two calendars one local and one shared and it is the sheared one that need populating. They have tried making the shared calendar the default and it still puts it in the other local calendar.
Did a bit of googling but can come up with an answer any suggestions?
Cheers
Dim objOutlook As Outlook.Application
Dim objAppt As Outlook.AppointmentItem
Dim objRecurPattern As Outlook.RecurrencePattern
Dim dayz As Long, N As String, SID As String
N = Forms![OutlookReminder_frm]![Name_Field]
SID = Forms![OutlookReminder_frm]![StudentID]
Dim total As Long
Set objOutlook = CreateObject("Outlook.Application")
Set objAppt = objOutlook.CreateItem(olAppointmentItem)
With objAppt
.Start = Forms![OutlookReminder_frm]![TxtDate] & " " & Forms![OutlookReminder_frm]![TxtTime] 'change this to Date and time - mine is from a combo boxes
.Subject = SID & " " & N & " " & Forms![OutlookReminder_frm]![TxtSubject]
.Duration = Forms![OutlookReminder_frm]![TxtDuration]
.ReminderSet = True
.ReminderMinutesBeforeStart = Forms![OutlookReminder_frm]![TxtReminder]
.Body = Nz(Forms![OutlookReminder_frm]![TxtBody], " ")
.Importance = olImportanceHigh
.Save
.Close (olSave)
End With
'Release the AppointmentItem object variable.
Set objAppt = Nothing
'Release the Outlook object variable.
Set objOutlook = Nothing
It seems this code just puts it in the default calendar but the user has two calendars one local and one shared and it is the sheared one that need populating. They have tried making the shared calendar the default and it still puts it in the other local calendar.
Did a bit of googling but can come up with an answer any suggestions?
Cheers