When I manually make a calendar reminder/appointment, I can then click "Invite Attendees" and chose the people to invite and then click "Send" and everyone will receive that calendar reminder/appointment.
I have the following code to make a reminder programmatically, but it won't send to the intended recipients. If I open the reminder after the script has run and click on "Invite Attendees" I can see the list is filled with the people I want to send the reminder to, so I'm not really sure why it's not actually sending the reminder to them.
Can anyone shed some light on this for me?
Private Function CreateAppointment(SubjectStr As String, BodyStr As String, StartTime As Date, EndTime As Date, AllDay As Boolean)
Dim olApp As Outlook.Application
Dim Appt As Outlook.AppointmentItem
' Only create the reminder if there's no duplicate
If (CheckForDuplicates(SubjectStr) = False) Then
Set olApp = CreateObject("Outlook.Application")
Set Appt = olApp.CreateItem(olAppointmentItem)
Appt.Recipients.Add ("John Doe")
Appt.Recipients.ResolveAll
Appt.Subject = SubjectStr
Appt.Start = StartTime
Appt.End = EndTime
Appt.AllDayEvent = AllDay
Appt.Body = BodyStr
Appt.ReminderSet = True
Appt.Save
Appt.Send
End If
Set Appt = Nothing
Set olApp = Nothing
End Function