• Outlook User
  • New Outlook app
  • Outlook.com
  • Outlook Mac
  • Outlook & iCloud
  • Developer
  • Microsoft 365 Admin
    • Common Problems
    • Microsoft 365
    • Outlook BCM
    • Utilities & Addins

Automatically Add a Category to Accepted Meetings

Slipstick Systems

› Outlook › Rules, Filters & Views › Automatically Add a Category to Accepted Meetings

Last reviewed on August 29, 2018     18 Comments

A security update disabled the Run a script option in the rules wizard in Outlook 2010 and all newer Outlook versions. See Run-a-Script Rules Missing in Outlook for more information and the registry key to fix restore it.

The idea for this macro came from Dan, who is looking for a way to assign a category when a meeting is accepted.

I would like to change the color of a meeting once the invitee accepts the invitation. Looking at my calendar if the meeting is still the default color I'd know I need to follow up to ensure they're going to attend. Do you know of a way to do this?

You can do this using a variation of our Autoaccept a Meeting Request using Rules macro, using it with a Run a Script rule to look for accepted meeting responses and then add a category to the associated appointment.

This method can be used to change any field in the associated appointment. Remember, if you change the subject, location, or time, Outlook will need to send an update.

How to use this macro

Open Outlook's VBA editor (Alt+F11), right click on Project1 and choose Insert > Module. Paste the code into the module, then create the rule with the 'run a script' Action and select this script.

Use a run a script rule to  change a meeting after it is accepted

Complete steps for using the VBA Editor and SelfCert are at How to use the VBA Editor

Sub AcceptedMeetings(oRequest As MeetingItem)
If oRequest.MessageClass <> "IPM.Schedule.Meeting.Resp.Pos" Then
  Exit Sub
End If
 
Dim oAppt As AppointmentItem
Set oAppt = oRequest.GetAssociatedAppointment(True)
oAppt.Categories = "Green"
oAppt.Save

End Sub

Check for Declines

To categorize the meeting if any required attendee has declined, check for Declined responses then check the recipients list to see if any were required.

Sub CheckDeclines(oRequest As MeetingItem)
' only check declines
If oRequest.MessageClass <> "IPM.Schedule.Meeting.Resp.Neg" Then
  Exit Sub
End If
 
Dim oAppt As AppointmentItem
Set oAppt = oRequest.GetAssociatedAppointment(True)

Dim objAttendees As Outlook.Recipients
Dim objAttendeeReq As String
Set objAttendees = oAppt.Recipients

For x = 1 To objAttendees.Count
   If objAttendees(x).Type = olRequired Then
    oAppt.Categories = "Declined;" & oAppt.Categories
   End If
Next
oAppt.Save

End Sub

Add Categories for Specific Attendees

To add a category based on the accepted recipients, use this script to check the recipient lists. This sets a category only if specific required attendees accept. As written, it uses their name as the category, but you can use a specific category (such as "Accepted") instead.

To use this to add a category named for each accepted attendees, move oAppt.Categories = objAttendeeReq & ";" & oAppt.Categories right after objAttendeeReq = objAttendees(x).Address and remove the lines following the first End If down to the last Next.

You can use attendee names or their email addresses, but the email address is generally more accurate for Internet addresses while the display name will work better for coworkers on Exchange server. You can check for the address then use the display name as the category.

Sub CategorizeMeetings(oRequest As MeetingItem)
If oRequest.MessageClass <> "IPM.Schedule.Meeting.Resp.Pos" Then
  Exit Sub
End If
 
Dim oAppt As AppointmentItem
Set oAppt = oRequest.GetAssociatedAppointment(True)

Dim objAttendees As Outlook.Recipients
Dim objAttendeeReq As String
Set objAttendees = oAppt.Recipients

For x = 1 To objAttendees.Count
   If objAttendees(x).Type = olRequired Then
      'objAttendeeReq = objAttendees(x).Name
      objAttendeeReq = objAttendees(x).Address
   End If
' Set up the array to check for specific people
arrRequired = Array("Diane Poremsky", "alias@domain.com", "diane@domain.com")

' Go through the array and look for a match, then do something
For i = LBound(arrRequired) To UBound(arrRequired)
    If InStr(LCase(objAttendeeReq), arrRequired(i)) Then
 ' new cat first
   oAppt.Categories = objAttendeeReq & ";" & oAppt.Categories
End If

Next i
Next

oAppt.Save

End Sub

To use these macros with declined or tentative responses, change the message class to one of the following message classes:

Message ClassResponse
IPM.Schedule.Meeting.Resp.PosAccepted meeting response
IPM.Schedule.Meeting.Resp.NegDeclined meeting response
IPM.Schedule.Meeting.Resp.TentTentative meeting response

More Information

More Run a Script Samples:

  • Autoaccept a Meeting Request using Rules
  • Automatically Add a Category to Accepted Meetings
  • Blocking Mail From New Top-Level Domains
  • Convert RTF Messages to Plain Text Format
  • Create a rule to delete mail after a number of days
  • Create a Task from an Email using a Rule
  • Create an Outlook Appointment from a Message
  • Create Appointment From Email Automatically
  • Delegates, Meeting Requests, and Rules
  • Delete attachments from messages
  • Forward meeting details to another address
  • How to Change the Font used for Outlook's RSS Feeds
  • How to Process Mail After Business Hours
  • Keep Canceled Meetings on Outlook's Calendar
  • Macro to Print Outlook email attachments as they arrive
  • Move messages CC'd to an address
  • Open All Hyperlinks in an Outlook Email Message
  • Outlook AutoReplies: One Script, Many Responses
  • Outlook's Rules and Alerts: Run a Script
  • Process messages received on a day of the week
  • Read Outlook Messages using Plain Text
  • Receive a Reminder When a Message Doesn't Arrive?
  • Run a script rule: Autoreply using a template
  • Run a script rule: Reply to a message
  • Run a Script Rule: Send a New Message when a Message Arrives
  • Run Rules Now using a Macro
  • Run-a-Script Rules Missing in Outlook
  • Save all incoming messages to the hard drive
  • Save and Rename Outlook Email Attachments
  • Save Attachments to the Hard Drive
  • Save Outlook Email as a PDF
  • Sort messages by Sender domain
  • Talking Reminders
  • To create a rule with wildcards
  • Use a Macro to Copy Data in an Email to Excel
  • Use a Rule to delete older messages as new ones arrive
  • Use a run a script rule to mark messages read
  • Use VBA to move messages with attachments
Automatically Add a Category to Accepted Meetings was last modified: August 29th, 2018 by Diane Poremsky

Related Posts:

  • Forward meeting details to another address
  • Delegates, Meeting Requests, and Rules
  • Keep Canceled Meetings on Outlook's Calendar
  • set a reminder using a rule
    Set a reminder when accepting a meeting request

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
18 Comments
newest
oldest most voted
Inline Feedbacks
View all comments

Angus
July 11, 2019 7:30 am

I have successfully created the 'run script' and copied/pasted the code to set up the auto change the meeting colour (to green as i see in the code it's written), however when I run the rule it does not work.

Any ideas?

0
0
Reply
Diane Poremsky
Author
Reply to  Angus
July 11, 2019 10:23 pm

Is macro security set to low?

You can test the macro on a selected items using this 'stub' macro. Change the macro name to be the same as your macro - select a meeting request in your inbox then run the macro.

Sub RunScript()
Dim objItem As Object
Set objItem = Application.ActiveExplorer.Selection.Item(1)

'macro name you want to run goes here
YourMacroName objItem

End Sub

0
0
Reply
Scott Martin
June 14, 2017 12:55 pm

Diane, I have been attempting to utilize this code for the past two days, but I have a disconnect somewhere that I cannot seem to correct. My problem seems to stem from the application of the category via vba. During my troubleshooting I used oAppt.Display and oAppt.ShowCategoriesDialog to attempt to detect why the category was not being added to the appointment after execution of the code. Apparently during the activation of the code the categories present are only the defaults ("Color Category"). But when opening the appointment or categories dialog manually I receive the full list of category options. Just for giggles I also tested the oRequest in the same fashion by opening the categories dialogue via vba, but in this case the dialog displays the full list of categories, and the code will successfully update the meeting invitation itself with any specified category. Also, even if I attempt to run the code for the update of the oAppt category as one of the default categories via vba, it doesn't update the appointment after activation of the code. My hypothesis is that it seems that the calendar environment is not accepting the input from the "default" categories dialogue when the… Read more »

0
0
Reply
Juliana
June 14, 2017 9:45 am

Thanks a lot for this, worked perfectly on only one occurrence meeting; do you have any code to check recurency meetings?
Example:
I have 10 meetings scheduled.
John accepts only 8 and decline 2 - I would like to see green on 8 and red on 2.

Is that possible?

0
0
Reply
Diane Poremsky
Author
Reply to  Juliana
June 15, 2017 8:16 pm

Unfortunately, no. The categories are all or nothing for recurring appointments.

0
0
Reply
Rick DeWeese
March 27, 2017 10:57 am

Diane,

First of all, thanks for putting this together. I have found this to be extremely helpful. This setup works wonderfully for single invitee meetings.

Of course when I run into something like this my mind starts to wander to more powerful uses.

So, here is the scenario:

I am an organizer of meetings with multiple attendees. There are several of these invitees that are mandatory and if they don't show up I need to reschedule the meeting. Or, I have a quorum that needs to be in attendance for these meetings.

The thought process would be similar. So, is there a way to pick out individual invitee responses and then use the category color coding to know visually if the meeting is good to go or needs to be rescheduled?

Again thanks so much. I find the code above to be brilliant!

0
0
Reply
Diane Poremsky
Author
Reply to  Rick DeWeese
April 2, 2017 8:27 am

you can use an if statement - you'll need to use the method at https://www.slipstick.com/developer/list-meeting-attendees-responses/ to get the attendesses and make a list of them.
if instr(1,strCopyData,"name") > 0 then
oAppt.Categories = "category" ";" & .categories
end if

to handle more than one name or category, you can use an array.

0
0
Reply
Diane Poremsky
Author
Reply to  Rick DeWeese
April 2, 2017 1:34 pm

Thinking over this more... i think you would want to see if anyone who is required has declined, rather than a specific person - added a macro that does this.
https://www.slipstick.com/outlook/rules/add-category-accepted-meetings/#decline

0
0
Reply
David Levine
February 22, 2017 8:53 am

So i got this to work for green with positive responses. But it does not work for yellow or red as i have assigned those to Tent and Neg responses. I did create yellow and red categories. I also created separate rules and test ran them independent. I want to add all three categories to an appointment as they respectively would apply. So for example if one person declines and two people will attend then it would be put into the green and red categories. If i test run the green category it works. I have my macros set to notify for all. Can anyone think of whats going on here? I am using outlook 365. Thank you

0
0
Reply
Diane Poremsky
Author
Reply to  David Levine
April 2, 2017 8:34 am

ass written, it replaces the categories already on the item. you need to add it like this:
oAppt.Categories = "Green" & ";" & .categories

0
0
Reply
Allie
March 15, 2016 3:20 pm

Can a similar setup be used to automatically assign a category for all meeting invitations sent?

0
0
Reply
Diane Poremsky
Author
Reply to  Allie
March 15, 2016 4:29 pm

Not for ones you send, but you can do it using one of two options: a custom form that has a category set or an macro that sets the category. I'll see if i can find a macro that will work (my attemps at using an item add macro failed).

0
0
Reply
Chip
February 15, 2016 10:53 am

Script works great for me - thanks! Note that you need to have a "category" for "Green" set-up with a color assigned in order for the appointments to actually change color in the calendar view. At least in Outlook 2010, that is...

0
0
Reply
Diane Poremsky
Author
Reply to  Chip
February 15, 2016 5:29 pm

It works that way in all the modern versions of Outlook.

0
0
Reply
Nupur
Reply to  Chip
December 4, 2019 11:52 am

Hi Chip/Diana,

What exactly is the code for having a category for green set up? I am not able to figure that out. Thanks in advance!

0
0
Reply
Josh
February 18, 2015 11:20 am

I am getting an error message as the rule executes. It his highlighting this line of code:
Dim oAppt As AppointmentItemSet

The error states "Compile Error: User-defined type not defined"

Does it matter that I am using Outlook 2010?

0
0
Reply
Diane Poremsky
Author
Reply to  Josh
February 18, 2015 11:19 pm

That has part of another line added to it - it should end with appointmentitem and set goes on the next line.
Dim oAppt As AppointmentItem
Set

0
0
Reply

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

Latest EMO: Vol. 30 Issue 28

Subscribe to Exchange Messaging Outlook






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?

Our Sponsors

CompanionLink
ReliefJet
  • Popular
  • Latest
  • Week Month All
  • Jetpack plugin with Stats module needs to be enabled.
  • Open Outlook Templates using PowerShell
  • Count and List Folders in Classic Outlook
  • Google Workspace and Outlook with POP Mail
  • Import EML Files into New Outlook
  • Opening PST files in New Outlook
  • New Outlook: Show To, CC, BCC in Replies
  • Insert Word Document into Email using VBA
  • Delete Empty Folders using PowerShell
  • Warn Before Deleting a Contact
  • Classic Outlook is NOT Going Away in 2026
Ajax spinner

Recent Bugs List

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

For new Outlook for Windows: Fixes or workarounds for recent issues in new Outlook for Windows .

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

Outlook.com Recent issues: Fixes or workarounds for recent issues on Outlook.com

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.

Outlook (new) Feedback. Use this for feedback and suggestions for Outlook (new).

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

Other Microsoft 365 applications and services




New Outlook Articles

Open Outlook Templates using PowerShell

Count and List Folders in Classic Outlook

Google Workspace and Outlook with POP Mail

Import EML Files into New Outlook

Opening PST files in New Outlook

New Outlook: Show To, CC, BCC in Replies

Insert Word Document into Email using VBA

Delete Empty Folders using PowerShell

Warn Before Deleting a Contact

Classic Outlook is NOT Going Away in 2026

Newest Code Samples

Open Outlook Templates using PowerShell

Count and List Folders in Classic Outlook

Insert Word Document into Email using VBA

Warn Before Deleting a Contact

Use PowerShell to Delete Attachments

Remove RE:, FWD:, and Other Prefixes from Subject Line

Change the Mailing Address Using PowerShell

Categorize @Mentioned Messages

Send an Email When You Open Outlook

Delete Old Calendar Events using VBA

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

VBOffice.net samples

SlovakTech.com

Outlook MVP David Lee

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

Diane Poremsky [Outlook MVP]

Make a donation

Mail Tools

Sending and Retrieval Tools

Mass Mail Tools

Compose Tools

Duplicate Remover Tools

Mail Tools for Outlook

Online Services

Calendar Tools

Schedule Management

Calendar Printing Tools

Calendar Reminder Tools

Calendar Dates & Data

Time and Billing Tools

Meeting Productivity Tools

Duplicate Remover Tools

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

Submit Outlook Feature Requests

Slipstick Support Services

Buy Microsoft 365 Office Software and Services

Visit Slipstick Forums.

What's New at Slipstick.com

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 | Slipstick Forums
Submit New or Updated Outlook and Exchange Server Utilities

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

:wpds_smile::wpds_grin::wpds_wink::wpds_mrgreen::wpds_neutral::wpds_twisted::wpds_arrow::wpds_shock::wpds_unamused::wpds_cool::wpds_evil::wpds_oops::wpds_razz::wpds_roll::wpds_cry::wpds_eek::wpds_lol::wpds_mad::wpds_sad::wpds_exclamation::wpds_question::wpds_idea::wpds_hmm::wpds_beg::wpds_whew::wpds_chuckle::wpds_silly::wpds_envy::wpds_shutmouth:
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