How to Auto Assign a Specific Color Category to a Meeting after Accepting It in Outlook

Many users wish Outlook to auto assign a specific color category to a meeting when they accept it. At present, this article will expose a piece of VBA code to achieve it with effortless ease.

To classify and highlight the accept meetings in the Outlook calendar, you may be used to assigning a specific color category to such meetings. In comparison with manually category assignment, which is a bit troublesome, you must prefer to let Outlook auto accomplish it. Therefore, in the followings, we will share you a way in detail.

Auto Assign a Specific Color Category to a Meeting after Accepting It

  1. For a start, launch Outlook application.
  2. Then, trigger Outlook VBA editor according to “How to Run VBA Code in Your Outlook“.
  3. Subsequently, put the following VBA code into “ThisOutlookSession” project.
Public WithEvents objSentFolder As Outlook.Folder
Public WithEvents objSentItems As Outlook.Items

Private Sub Application_Startup()
    Set objSentFolder = Outlook.Application.Session.GetDefaultFolder(olFolderSentMail)
    Set objSentItems = objSentFolder.Items
End Sub

Private Sub objSentItems_ItemAdd(ByVal Item As Object)
    Dim objMeetingItem As Outlook.MeetingItem
    Dim objMeetingAcceptance As Outlook.MeetingItem
    Dim objMeeting As Outlook.AppointmentItem

   'If a meeting acceptance item arrives in "Sent Items" folder
    If TypeOf Item Is MeetingItem Then
       Set objMeetingItem = Item
       If Left(objMeetingItem.Subject, 9) = "Accepted:" Then
          Set objMeetingAcceptance = objMeetingItem

          'Get the corresponding meeting in Calendar
          Set objMeeting = objMeetingAcceptance.GetAssociatedAppointment(True)
          'Assign a specific color category to the meeting
          objMeeting.Categories = objMeeting.Categories & "Yellow Category"
       End If
    End If
End Sub

VBA Code - Auto Assign a Specific Color Category to a Meeting after Accepting It

  1. Next, change “Yellow Category” to your desired color category name.
  2. After that, restart your Outlook application to trigger this macro.
  3. Eventually, you can have a try.
  • First off, open a meeting which you haven’t responded to.
  • Then, click “Accept” and select “Send the Response Now” option.Accept the Meeting
  • After the meeting acceptance response is sent, the specific color category will be assigned to the corresponding meeting at once.Specific Color Category Is Assigned to the Meeting

Take Care of Your Outlook File

Outlook PST file is vulnerable. Thus, you have to keep careful of your Outlook file. For instance, you need clean up the old and useless Outlook items to ensure that Outlook file is in small size. And you have to beware of the suspicious emails from unknown senders in that these emails may contain viruses or malware which can directly result in Outlook corruption. It is admittedly difficult to restore damaged Outlook data unless you resort to remarkable Outlook recovery software, such as DataNumen Outlook Repair.

Author Introduction:

Shirley Zhang is a data recovery expert in DataNumen, Inc., which is the world leader in data recovery technologies, including SQL Server fix and outlook repair software products. For more information visit

Comments are closed.