If you are classifying Outlook meetings by color categories and want to set different reminder time for meetings in different color categories, you can refer to this article. Here we will teach you to realize it with Outlook VBA.
For instance, you are dividing meetings into two groups. One is in “Offsite” color category in that the meeting location is too far, and the other is in “Onsite” color category as the location is right here. Now, you want that Outlook can auto set the reminder time of “offsite” meeting as 1 hour before start and “onsite” meeting as 15 minute before start. Looking at this requirement, thereinafter, we will share a quick method.
Auto Set Different Reminder for Meetings in Different Color Categories
- To begin with, launch your Outlook application.
- Then, press “Alt + F11” key buttons to access VBA editor window.
- Next, in the subsequent window, copy and paste the VBA code below into the “ThisOutlookSession” project.
Public WithEvents objCalendar As Outlook.Folder Public WithEvents objCalendarItems As Outlook.Items Private Sub Application_Startup() Set objCalendar = Outlook.Application.Session.GetDefaultFolder(olFolderCalendar) Set objCalendarItems = objCalendar.Items End Sub Private Sub objCalendarItems_ItemAdd(ByVal Item As Object) Call SetReminder_BasedOnCategories(Item) End Sub Private Sub objCalendarItems_ItemChange(ByVal Item As Object) Call SetReminder_BasedOnCategories(Item) End Sub Private Sub SetReminder_BasedOnCategories(ByVal objCalendarItem As Object) Dim objMeeting As Outlook.AppointmentItem Dim strCategories As String If objCalendarItem.Class = olAppointment Then 'Check if the item is a meeting If objCalendarItem.MeetingStatus = olMeeting Then Set objMeeting = objCalendarItem strCategories = objMeeting.Categories 'Set Reminder as 60 min before start for offsite appointments If InStr(strCategories, "Offsite") > 0 Then With objMeeting .ReminderSet = True .ReminderMinutesBeforeStart = 60 .Save End With 'Set Reminder as 15 min before start for onsite appointments ElseIf InStr(strCategories, "Onsite") > 0 Then With objMeeting .ReminderSet = True .ReminderMinutesBeforeStart = 15 .Save End With End If End If End If End Sub
- Later, you need click into the “Application_Startup” subroutine and press “F5” key button to run this macro.
- Since then, every time when a new meeting is added to the default calendar or you change an existing meeting, Outlook will auto check the categories of the meeting and auto set the different reminder time.
Eliminate Outlook Errors
Various issues may occur to Outlook from time to time. Therefore, it is extremely important for users to learn how to cope with Outlook issues. For a start, you had better make regular Outlook data backups. Moreover, if affordable, it is suggested to keep a potent Outlook repair tool nearby, such as DataNumen Outlook Repair. It can scan your PST file to figure out Outlook issues and then resolve them with ease.
Author Introduction:
Shirley Zhang is a data recovery expert in DataNumen, Inc., which is the world leader in data recovery technologies, including sql recovery and outlook repair software products. For more information visit www.datanumen.com
1
I instituted the code as suppied and it caused an infinite loop because the update itself triggered another execution of the subroutine, which did the same thing, etc. It needs to have logic added to not perform the update if it has already been performed.
Thanks for this, I missed two meetings today that were sent to me without reminders. I modified your code to add a reminder if there wasn’t one.
Private Sub SetReminder_IfMissing(ByVal objCalendarItem As Object)
Dim objMeeting As Outlook.AppointmentItem
If objCalendarItem.Class = olAppointment Then
‘Check if the item is a meeting
If objCalendarItem.MeetingStatus = olMeeting Then
Set objMeeting = objCalendarItem
‘Set Reminder to 15 minutes if there isn’t a reminder already set
If Not objMeeting.ReminderSet Then
With objMeeting
.ReminderSet = True
.ReminderMinutesBeforeStart = 15
.Save
End With
End If
End If
End If
End Sub