Skip to main content

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

Author: Xiaoyang Last Modified: 2018-05-28

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.


Best Office Productivity Tools

Breaking News: Kutools for Outlook Launches Free Version!

Experience the all-new Kutools for Outlook FREE version with 70+ incredible features, yours to use FOREVER! Click to download now!

πŸ€– Kutools AI : Instant pro emails with AI magic--one-click to genius replies, perfect tone, multilingual mastery. Transform emailing effortlessly! ...

πŸ“§ Email Automation: Auto Reply (Available for POP and IMAP)  /  Schedule Send Emails  /  Auto CC/BCC by Rules When Sending Email  /  Auto Forward (Advanced Rules)   /  Auto Add Greeting   /  Automatically Split Multi-Recipient Emails into Individual Messages ...

πŸ“¨ Email Management: Recall Emails  /  Block Scam Emails by Subjects and Others  /  Delete Duplicate Emails  /  Advanced Search  /  Consolidate Folders ...

πŸ“ Attachments ProBatch Save  /  Batch Detach  /  Batch Compress  /  Auto Save   /  Auto Detach  /  Auto Compress ...

🌟 Interface Magic: 😊More Pretty and Cool Emojis   /  Remind you when important emails come  /  Minimize Outlook Instead of Closing ...

πŸ‘ One-click Wonders: Reply All with Incoming Attachments  /   Anti-Phishing Emails  /  πŸ•˜Show Sender's Time Zone ...

πŸ‘©πŸΌβ€πŸ€β€πŸ‘©πŸ» Contacts & Calendar: Batch Add Contacts From Selected Emails  /  Split a Contact Group to Individual Groups  /  Remove Birthday Reminders ...

Instantly unlock Kutools for Outlook with a single clickβ€”permanently free. Don't wait, download now and boost your efficiency!

kutools for outlook features1 kutools for outlook features2
 

 

 

Comments (0)
No ratings yet. Be the first to rate!
There are no comments posted here yet
Leave your comments
Posting as Guest
Rate this post:
0   Characters
Suggested Locations