• Outlook User
  • Exchange Admin
  • Office 365
  • Outlook Developer
  • Outlook.com
  • Outlook Mac
  • Outlook & iCloud
    • Common Problems
    • Outlook BCM
    • Utilities & Addins

Send an Email When a Reminder Fires

Slipstick Systems

› Developer › Send an Email When a Reminder Fires

Last reviewed on August 3, 2020     285 Comments

Another entry in my Lazy Programmer Series, this time I have a macro that sends an email message when a reminder fires. This macro was the result of a request for the ability to send messages to the sales team each morning with the day's agenda.

If you prefer to use an add-in, I have a list of reminder tools at
"Outlook Reminders Don't Come into Focus"

You can use the macro to send yourself reminders or even to compose an email message ahead of time (in the body of a an appointment form) and send it later. Outlook will need to be running and be able to connect to the mail server for the message to be generated and sent.

Because the message is composed when the reminder fires, the message time stamp will be the reminder time. Please don't abuse the trust others have in you: use this macro for legitimate purposes, not to convince someone you were working when you weren't!

Outlook needs to be running for these macros to work. Note, this will trigger the email security alert in older versions of Outlook. Use one of the tools listed at the end to dismiss the dialogs.

To use, press Alt+F11 to open the VBA editor then copy the code and paste it into ThisOutlookSession.

Send a message to someone when a reminder fires

This macro checks for Appointment reminders and sends a message to the value in the location field. For this to be useful, you need to use a category, otherwise Outlook will attempt to send a message with every appointment reminder.

Private Sub Application_Reminder(ByVal Item As Object)
  Dim objMsg As MailItem
  
'IPM.TaskItem to watch for Task Reminders
If Item.MessageClass <> "IPM.Appointment" Then
  Exit Sub
End If

If Item.Categories <> "Send Message" Then
  Exit Sub
End If

Set objMsg = Application.CreateItem(olMailItem)
With objMsg
  .To = Item.Location
  .BCC = "me@slipstick.com"
  .Subject = Item.Subject
  .Body = Item.Body
  .Send
End With
  Set objMsg = Nothing
End Sub

To use a template instead of the default message form, replace Set objMsg = Application.CreateItem(olMailItem) with Set objMsg = Application.CreateItemFromTemplate("C:\path\to\test-rule.oft")

 

Send a message to yourself when a reminder fires

This is the original code we had on this page and sends an email message to an address when any reminder fires.

Private Sub Application_Reminder(ByVal Item As Object)
  Dim objMsg As MailItem

  Set objMsg = Application.CreateItem(olMailItem)

  objMsg.To = "alias@domain.com"
  objMsg.Subject = "Reminder: " & Item.Subject

  ' Code to handle the 4 types of items that can generate reminders
  Select Case Item.Class
     Case olAppointment '26
        objMsg.Body = _
          "Start: " & Item.Start & vbCrLf & _
          "End: " & Item.End & vbCrLf & _
          "Location: " & Item.Location & vbCrLf & _
          "Details: " & vbCrLf & Item.Body
     Case olContact '40
        objMsg.Body = _
          "Contact: " & Item.FullName & vbCrLf & _
          "Phone: " & Item.BusinessTelephoneNumber & vbCrLf & _
          "Contact Details: " & vbCrLf & Item.Body
      Case olMail '43
        objMsg.Body = _
          "Due: " & Item.FlagDueBy & vbCrLf & _
          "Details: " & vbCrLf & Item.Body
      Case olTask '48
        objMsg.Body = _
          "Start: " & Item.StartDate & vbCrLf & _
          "End: " & Item.DueDate & vbCrLf & _
          "Details: " & vbCrLf & Item.Body
  End Select
 
  objMsg.Send
  Set objMsg = Nothing
End Sub

Change the From account

This macro sets the From field to use a different account in your profile.

Private Sub Application_Reminder(ByVal Item As Object)
  Dim olNS As Outlook.NameSpace
  Dim objMsg As MailItem

'IPM.TaskItem to watch for Task Reminders
If Item.MessageClass <> "IPM.Appointment" Then
  Exit Sub
End If

If Item.Categories <> "Send Message" Then
  Exit Sub
End If

Set olNS = Application.GetNamespace("MAPI")
Set objMsg = Application.CreateItem(olMailItem)
With objMsg
' based on the list in Account Settings
   .SendUsingAccount = olNS.Accounts.Item(1)
  .To = Item.Location
  .BCC = "me@slipstick.com"
  .Subject = Item.Subject
  .Body = Item.Body
  .Send
End With
  Set objMsg = Nothing
End Sub

Send a message to all attendees

This version of the macro sends a reminder to all attendees. As written, it does not check to see if the attendee accepted or declined, but the macro could do that. I have sample code at Create a List of Meeting Attendees and Responses which creates a list of attendees and their responses that shows how to get this information.

Private Sub Application_Reminder(ByVal Item As Object)
  Dim objMsg As MailItem

If Item.MessageClass <> "IPM.Appointment" Then
  Exit Sub
End If

'If Item.Categories <> "Send Message" Then
'  Exit Sub
'End If

' Get The Attendee List
Dim objAttendees As Outlook.Recipients
Dim objAttendeeReq As String
Dim objAttendeeOpt As String
Dim objOrganizer As String

Set objAttendees = Item.Recipients

For x = 1 To objAttendees.Count
  
   If objAttendees(x).Type = olRequired Then
      objAttendeeReq = objAttendees(x) & ";" & objAttendeeReq
   ElseIf objAttendees(x).Type = olOptional Then
      objAttendeeOpt = objAttendees(x) & ";" & objAttendeeOpt
   End If
Next
  
Debug.Print objAttendeeReq, objAttendeeOpt
  Set objMsg = Application.CreateItem(olMailItem)
With objMsg
  .To = objAttendeeReq
  .CC = objAttendeeOpt
  .Subject = Item.Subject
  .Body = Item.Body
  .Send
End With

  Set objMsg = Nothing
End Sub

 

Send a Draft when a Reminder Fires

This macro sends a draft message when a reminder fires. This allows you to use more formatting and HTML features in the message.

To use: Create the message and save it. Copy the subject line. Create the appointment, pasting the subject in the Location field. Set the appointment for the date and time you want the draft sent.

Adapted from "Scheduling Drafts in Outlook"

Private Sub Application_Reminder(ByVal Item As Object)
  Dim objMsg As MailItem
  Set objMsg = Application.CreateItem(olMailItem)
 
'IPM.TaskItem to watch for Task Reminders
If Item.MessageClass <> "IPM.Appointment" Then
  Exit Sub
End If
 
If Item.Categories <> "Send Message" Then
  Exit Sub
End If
 
Dim NS As Outlook.NameSpace
Dim DraftsFolder As Outlook.MAPIFolder
Dim Drafts As Outlook.Items
Dim DraftItem As Outlook.MailItem
Dim lDraftCount As Long
  
Set DraftsFolder = Session.GetDefaultFolder(olFolderDrafts)
Set Drafts = DraftsFolder.Items
  
'Loop through all Draft Items
For lDraftCount = Drafts.Count To 1 Step -1
Set DraftItem = Drafts.Item(lDraftCount)
 
If DraftItem.Subject = Item.Location Then
'Send Item
  DraftItem.Send
End If

Next lDraftCount
 
'Clean-up
Set DraftsFolder = Nothing
Set objMsg = Nothing
End Sub

 

Select an appointment and send a message

With a few tweaks, the macro above can be used to send a message by selecting the appointment then running the macro.

  1. Press Alt+F11 to open the VBA editor.
  2. Right click on Project1 and choose Insert > Module.
  3. Paste the code below into the Module.
  4. Get the GetCurrentItem function from Outlook VBA: work with open item or selected item and paste it into the module.

Public Sub App_Reminder()
  Dim Item As AppointmentItem
  Dim objMsg As MailItem
  Set objMsg = Application.CreateItem(olMailItem)

Set Item = GetCurrentItem()

With objMsg
'  .To = Item.Location
  .Subject = Item.Subject
  .Body = Item.Body
  .Display ' use .Send to send it instead 
End With

Set objMsg = Nothing
Set Item = Nothing

End Sub

 

Dismiss the Reminder (and send a message)

This version of the macro dismisses the reminder when it comes up and sends the message. To do this, we need to use the BeforeReminderShow method and declare olRemind and strSubject outside of the macro.

Private WithEvents olRemind As Outlook.Reminders
Dim strSubject As String

Private Sub Application_Reminder(ByVal Item As Object)
Set olRemind = Outlook.Reminders
 
'IPM.TaskItem to watch for Task Reminders
If Item.MessageClass <> "IPM.Appointment" Then
  Exit Sub
End If
 
If Item.Categories <> "Send Message" Then
  Exit Sub
End If
 
strSubject = Item.Subject
  Dim objMsg As MailItem
Set objMsg = Application.CreateItem(olMailItem)
 
  objMsg.To = Item.Location
  objMsg.BCC = "me@slipstick.com"
  objMsg.Subject = strSubject 
  objMsg.Body = Item.Body
  objMsg.Send

  Set objMsg = Nothing
  
End Sub

Private Sub olRemind_BeforeReminderShow(Cancel As Boolean)

    For Each objRem In olRemind
            If objRem.Caption = strSubject Then
                If objRem.IsVisible Then
                    objRem.Dismiss
                    Cancel = True
                End If
                Exit For
            End If
        Next objRem

End Sub

 

Pop up a dialog

You can use the code on this page to do pretty much anything VBA can do when the reminder fires.
msgbox reminder dialof

This simple code sample displays a dialog box to remind you.

Private Sub Application_Reminder(ByVal Item As Object)
 
If Item.MessageClass <> "IPM.Appointment" Then
  Exit Sub
End If

MsgBox "You have an appointment for " & vbCrLf _
  & Item.Subject & vbCrLf _
  & "on " & Format(Item.Start, "mmm dd") & vbCrLf _
  & "Time: " & Format(Item.Start, "hh:mm AM/PM") _
  & vbCrLf & "Location: " & Item.Location
 
End Sub

Video Tutorial

How to use the macro

First: You will need macro security set to low during testing.

To check your macro security in Outlook 2010 or 2013, go to File, Options, Trust Center and open Trust Center Settings, and change the Macro Settings. In Outlook 2007 and older, it’s at Tools, Macro Security. If Outlook tells you it needs to be restarted, close and reopen Outlook. Note: after you test the macro and see that it works, you can either leave macro security set to low or sign the macro.

Now open the VBA Editor by pressing Alt+F11 on your keyboard.

To use the macro code in ThisOutlookSession:

  1. Expand Project1 and double click on ThisOutlookSession.
  2. Copy then paste the macro into ThisOutlookSession. (Click within the code, Select All using Ctrl+A, Ctrl+C to copy, Ctrl+V to paste.)

Application_Startup macros run when Outlook starts. If you are using an Application_Startup macro you can test the macro without restarting Outlook by clicking in the first line of the Application_Startup macro then clicking the Run button on the toolbar or pressing F8.

More information as well as screenshots are at How to use the VBA Editor.

[addins name=macros]

More Information

Open a webpage when a Task reminder fires
To send an email daily using a Task, see E-Mail: Send daily (vboffice.net)

Send an Email When a Reminder Fires was last modified: August 3rd, 2020 by Diane Poremsky
  • Twitter
  • Facebook
  • LinkedIn
  • Reddit
  • Print

Related Posts:

  • Send an Email When You Add an Appointment to Your Calendar
  • Use this macro to send an attachment to email addresses in the To line
    VBA: No attachments to CC'd recipients
  • Open a Webpage when a Task Reminder Fires
  • Create a new Outlook message using VBA

About Diane Poremsky

A Microsoft Outlook Most Valuable Professional (MVP) since 1999, Diane is the author of several books, including Outlook 2013 Absolute Beginners Book. She also created video training CDs and online training classes for Microsoft Outlook. You can find her helping people online in Outlook Forums as well as in the Microsoft Answers and TechNet forums.

Subscribe
Notify of
285 Comments
newest
oldest most voted
Inline Feedbacks
View all comments

Darren (@guest_219624)
August 11, 2022 12:56 pm
#219624

How can I inject the “Tomorrows Agenda” .ics attachment into this so it’s automated?

0
0
Reply
Diane Poremsky(@diane-poremsky)
Author
Reply to  Darren
August 11, 2022 11:53 pm
#219626

Blend two macros -
https://www.slipstick.com/outlook/calendar/email-tomorrows-agenda/

At the end of the agenda article is a macro that automates it using a reminder.

0
0
Reply
Damaris Lira (@guest_219591)
August 3, 2022 11:35 am
#219591

This is great! I was wondering if an email can be sent to myself 2 weeks after the calendar event as a reminder to follow up with people that were in the meeting? I remember this being an option but I don't see it in Outlook 2016

0
0
Reply
Diane Poremsky(@diane-poremsky)
Author
Reply to  Damaris Lira
August 11, 2022 11:51 pm
#219625

It was not an option in Outlook. It would be possible using a macro - I think it would be easiest to make a new task then for 2 weeks out and list the attendees in the task with your follow up note. If you wanted to use the original meeting, you'd need to change the reminder. Either could be done when the initial meeting reminder fires.

0
0
Reply
Charles (@guest_219245)
April 27, 2022 7:51 am
#219245

Ok sorry I have seen now the Dismiss the reminder part

0
0
Reply
Charles (@guest_219244)
April 27, 2022 6:27 am
#219244

Hello Diane,
First I would like to thank you for your help and this macro will help me a lot to remind my managers to do things... Even if there is plenty of task app, I find the email still the best way to remind tasks.
Anyway Is there a solution for the reminder not to pop up in the case where it's used only to send an email ?
Thanks a lot from France (excuse my english)
Charles

0
0
Reply
Lew (@guest_219156)
February 6, 2022 9:21 pm
#219156

Hi Diane,
Your code samples have been a great help and I've learned much from them. I've run into a recent problem and would greatly appreciate your help. I've modified your code above to display a userform instead of the standard Outlook Reminder, which works very well most of the time. The problem is occurring in Outlook 2016 (update KB3141453 installed): If the myform.show() method (modeless) executes while the user is simultaneously typing in the body of an email (Explorer or Inspector windows), Outlook 2016 crashes(freezes). This does not happen in Outlook 365. Any idea what is going on in Outlook 2016 and how to fix it?

0
0
Reply
Tina Meng (@guest_217143)
November 3, 2020 5:58 am
#217143

Hi Diane,
Is it possible to get this to work from a shared calendar or only my private calendar? 
It works perfectly from my own calendar.

0
0
Reply
Diane Poremsky(@diane-poremsky)
Author
Reply to  Tina Meng
September 7, 2021 9:16 pm
#218716

If reminders fire from the calendar, yes, it will work. They don't fire from shared mailboxes though.

0
0
Reply
Alex McHugh (@guest_215436)
June 16, 2020 4:57 am
#215436

If you have other items in your Drafts folder than MailItems, the script will fail.
 
Need to wrap the code inside the For Loop with something like this:
 
If TypeName(Drafts.Item(lDraftCount)) = "MailItem" Then
'Code that acts on draft items
End If

0
0
Reply
Alvin.L (@guest_213833)
August 29, 2019 6:09 am
#213833

Hi Diane,

Love your works here, i wan to create a recurring email with the below but i cant seem to trigger it when i see my reminder

Private Sub Application_Reminder(ByVal Item As Object)
Dim objMsg As MailItem
Set objMsg = Application.CreateItem()

'IPM.TaskItem to watch for Task Reminders
If Item.MessageClass "IPM.Appointment" Then
Exit Sub
End If

If Item.Categories "Send Message" Then
Exit Sub
End If

objMsg.To = "xxxx1@gmail.com"
objMsg.BCC = "xxxx@gmail.com"
objMsg.Subject = Item.Subject
objMsg.Body = Item.Body
objMsg.Send

Set objMsg = Nothing

0
0
Reply

Visit Slipstick Forums.
What's New at Slipstick.com

Latest EMO: Vol. 28 Issue 21

Support Services

Do you need help setting up Outlook, moving your email to a new computer, migrating or configuring Office 365, or just need some one-on-one assistance?

Subscribe to Exchange Messaging Outlook






Our Sponsors

CompanionLink
ReliefJet
  • Popular
  • Latest
  • WeekMonthAll
  • How to Remove the Primary Account from Outlook
  • Adjusting Outlook's Zoom Setting in Email
  • Uninstall Updates in Office 'Click to Run'
  • Move an Outlook Personal Folders .pst File
  • Save Sent Items in Shared Mailbox Sent Items folder
  • Create rules that apply to an entire domain
  • View Shared Calendar Category Colors
  • How to Create a Pick-a-Meeting Request
  • Outlook's Left Navigation Bar
  • Use PowerShell to get a list of Distribution Group members
  • Create a rule to delete spam with no sender address
  • Open Outlook Folders using PowerShell or VBScript
  • Cannot add Recipients in To, CC, BCC fields on MacOS
  • Change Appointment Reminder Sounds
  • Messages appear duplicated in message list
  • Reset the New Outlook Profile
  • Delete Old Calendar Events using VBA
  • Use PowerShell or VBA to get Outlook folder creation date
  • Outlook's Left Navigation Bar
  • Contact's Display Bug
Ajax spinner

Newest Code Samples

Delete Old Calendar Events using VBA

Use PowerShell or VBA to get Outlook folder creation date

Rename Outlook Attachments

Format Images in Outlook Email

Set Outlook Online or Offline using VBScript or PowerShell

List snoozed reminders and snooze-times

Search your Contacts using PowerShell

Filter mail when you are not the only recipient

Add Contact Information to a Task

Process Mail that was Auto Forwarded by a Rule

Recent Bugs List

Microsoft keeps a running list of issues affecting recently released updates at Fixes or workarounds for recent issues in Outlook for Windows.

Outlook for Mac Recent issues: Fixes or workarounds for recent issues in Outlook for Mac

Office Update History

Update history for supported Office versions is at Update history for Office

Outlook Suggestions and Feedback

Outlook Feedback covers Outlook as an email client, including Outlook Android, iOS, Mac, and Windows clients, as well as the browser extension (PWA) and Outlook on the web.

Use Outlook.com Feedback for suggestions or feedback about Outlook.com accounts.

Other Microsoft 365 applications and services




Windows 10 Issues

  • iCloud, Outlook 2016, and Windows 10
  • Outlook Links Won’t Open In Windows 10
  • Outlook can’t send mail in Windows 10: error Ox800CCC13
  • Missing Outlook data files after upgrading Windows?

Outlook Top Issues

  • The Windows Store Outlook App
  • The Signature or Stationery and Fonts button doesn’t work
  • Outlook’s New Account Setup Wizard
  • Outlook 2016: No BCM
  • Exchange Account Set-up Missing in Outlook 2016

VBA Basics

How to use the VBA Editor

Work with open item or selected item

Working with All Items in a Folder or Selected Items

VBA and non-default Outlook Folders

Backup and save your Outlook VBA macros

Get text using Left, Right, Mid, Len, InStr

Using Arrays in Outlook macros

Use RegEx to extract message text

Paste clipboard contents

Windows Folder Picker

Custom Forms

Designing Microsoft Outlook Forms

Set a custom form as default

Developer Resources

Developer Resources

Developer Tools

Outlook-tips.net Samples

VBOffice.net samples

SlovakTech.com

Outlook MVP David Lee

MSDN Outlook Dev Forum

Repair PST

Convert an OST to PST

Repair damaged PST file

Repair large PST File

Remove password from PST

Merge Two Data Files

Sync & Share Outlook Data

  • Share Calendar & Contacts
  • Synchronize two computers
  • Sync Calendar and Contacts Using Outlook.com
  • Sync Outlook & Android Devices
  • Sync Google Calendar with Outlook
  • Access Folders in Other Users Mailboxes

Contact Tools

Data Entry and Updating

Duplicate Checkers

Phone Number Updates

Contact Management Tools

Diane Poremsky [Outlook MVP]

Make a donation

Calendar Tools

Schedule Management

Calendar Printing Tools

Calendar Reminder Tools

Calendar Dates & Data

Time and Billing Tools

Meeting Productivity Tools

Duplicate Remover Tools

Mail Tools

Sending and Retrieval Tools

Mass Mail Tools

Compose Tools

Duplicate Remover Tools

Mail Tools for Outlook

Online Services

Productivity

Productivity Tools

Automatic Message Processing Tools

Special Function Automatic Processing Tools

Housekeeping and Message Management

Task Tools

Project and Business Management Tools

Choosing the Folder to Save a Sent Message In

Run Rules on messages after reading

Help & Suggestions

Outlook Suggestion Box (UserVoice)

Slipstick Support Services

Home | Outlook User | Exchange Administrator | Office 365 | Outlook.com | Outlook Developer
Outlook for Mac | Common Problems | Utilities & Addins | Tutorials
Outlook & iCloud Issues | Outlook Apps
EMO Archives | About Slipstick | Advertise | Slipstick Forums
Submit New or Updated Outlook and Exchange Server Utilities

Send comments using our Feedback page
Copyright © 2023 Slipstick Systems. All rights reserved.
Slipstick Systems is not affiliated with Microsoft Corporation.

wpDiscuz

Sign up for Exchange Messaging Outlook

Our weekly Outlook & Exchange newsletter (bi-weekly during the summer)






Please note: If you subscribed to Exchange Messaging Outlook before August 2019, please re-subscribe.

Never see this message again.

You are going to send email to

Move Comment