Sending Outlook Calendar Reminders as Emails
November 24th, 2009 Posted in dailySomeone at work just asked me if they could get email reminders of Birthday calendar events, and I found this Microsoft KB article about writing VB code to accomplish this. I tweaked the code a little bit, but it seems to be working find so far. Note – Outlook must remain open for the reminder emails to be sent.
Private Sub Application_Reminder(ByVal Item As Object)
If Item.Sensitivity <> olConfidential Then
If InStr(1, Item.Subject, "birthday", vbTextCompare) > 0 Then
If TypeOf Item Is AppointmentItem Then SendApptReminder Item
End If
End If
End Sub
Private Sub SendApptReminder(ByRef Item As AppointmentItem)
SendPage Item.Subject & " Reminder", Item.Subject & " - " & FormatDateTime(Item.Start, vbGeneralDate) & vbCrLf & _
Item.Location
End Sub
Private Sub SendPage(ByRef Subject As String, ByRef Body As String)
Dim oEmail As Object
Set oEmail = Application.CreateItem(olMailItem)
oEmail.Subject = Subject
oEmail.Body = Body
oEmail.Recipients.Add "Contact For Reminders"
oEmail.Send
End Sub
