Skip to content

Instantly share code, notes, and snippets.

@alatas
Created December 20, 2016 12:55
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alatas/2b562e9f19e2909f746fa25431db7cf6 to your computer and use it in GitHub Desktop.
Save alatas/2b562e9f19e2909f746fa25431db7cf6 to your computer and use it in GitHub Desktop.
auto clear categories on new email / Outlook
Private Sub Application_NewMailEx(ByVal EntryIDCollection As String)
Dim objNS As Outlook.NameSpace
Dim objEmail As Outlook.MailItem
Dim strIDs() As String
Dim intX As Integer
strIDs = Split(EntryIDCollection, ",")
For intX = 0 To UBound(strIDs)
Set objNS = Application.GetNamespace("MAPI")
Set objEmail = objNS.GetItemFromID(strIDs(intX))
objEmail.Categories = ""
objEmail.Save
Next
Set objEmail = Nothing
End Sub
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment