How to automatically assign color category to meetings after accepting them in Outlook?

In your daily work, you may receive multiple meeting emails in Outlook. Sometimes, you wish to assign a specific color category to meetings automatically when they are accepted. Normally, you can assign them manually, but, this will be troublesome to set them one by one. In this article, I will talk about how to auto accomplish it in Outlook.

Automatically assign color category to meetings after accepting them with VBA code


Automatically assign color category to meetings after accepting them with VBA code

1. Hold down the ALT + F11 keys to open the Microsoft Visual Basic for Applications window.

2. In the Microsoft Visual Basic for Applications window, double click ThisOutlookSession from the Project1(VbaProject.OTM) pane to open the mode, and then copy and paste the following code into the blank module.

VBA code: Auto assign color category to meetings after accepting them

Public WithEvents SentItems As Outlook.Items
Private Sub Application_Startup()
    Set SentItems = Outlook.Application.Session.GetDefaultFolder(olFolderSentMail).Items
End Sub
Private Sub SentItems_ItemAdd(ByVal Item As Object)
Dim xMeetingItem As Outlook.MeetingItem
Dim xMeetingItemAccepted As Outlook.MeetingItem
Dim xAppointmentItem As Outlook.AppointmentItem
On Error Resume Next
If TypeOf Item Is MeetingItem Then
    Set xMeetingItem = Item
    If InStr(xMeetingItem.Subject, "Accepted:") = 1 Then
        Set xMeetingItemAccepted = xMeetingItem
        Set xAppointmentItem = xMeetingItemAccepted.GetAssociatedAppointment(True)
        With xAppointmentItem
            .Categories = .Categories & "Red Category"
            .Save
        End With
    End If
End If
End Sub

doc auto categorize meetings 1

Note: In the above code, you can change Red Category to your desired color category name.

3. And then, restart your Outlook to trigger this macro.

4. Then, after accepting the meeting email, and click Send the Respond Now option, the specific color category will be assigned to the accepted meeting at once. See screenshot:

doc auto categorize meetings 2

Note: This code is only applied to the default data account.


Kutools for Outlook - Brings 100 Advanced Features to Outlook, and Make Work Much Easier!

  • Auto CC/BCC by rules when sending email; Auto Forward Multiple Emails by custom; Auto Reply without exchange server, and more automatic features...
  • BCC Warning - show message when you try to reply all if your mail address is in the BCC list; Remind When Missing Attachments, and more remind features...
  • Reply (All) With All Attachments in the mail conversation; Reply Many Emails in seconds; Auto Add Greeting when reply; Add Date into subject...
  • Attachment Tools: Manage All Attachments in All Mails, Auto Detach, Compress All, Rename All, Save All... Quick Report, Count Selected Mails...
  • Powerful Junk Emails by custom; Remove Duplicate Mails and Contacts... Enable you to do smarter, faster and better in Outlook.
shot kutools outlook kutools tab 1180x121
shot kutools outlook kutools plus tab 1180x121
 

Say something here...
symbols left.
You are guest ( Sign Up? )
or post as a guest, but your post won't be published automatically.
Loading comment... The comment will be refreshed after 00:00.

Be the first to comment.