I'm using Outlook 2019 on Win10.
My company adds the prefix "[EXT]:" to the subject line of all emails received from outside our network. This includes invitations. Because of this, "[EXT]:" is in most of my calendar. It makes it hard to look at a busy calendar from my phone when 90% of the subjects start with [EXT]:
I can figure out VBA code to look for RE: or Fwd: or [EXT]: in subject lines and replace/delete them.
How do I trigger the VBA code automatically when Accept, Accept with Response, Tentative, etc. buttons/pulldowns are clicked?
When any of these buttons are clicked the response is sent back to the organizer and you may try to handle the
ItemSendevent of theApplicationclass in Outlook which is fired whenever an Microsoft Outlook item is sent, either by the user through an Inspector (before the inspector is closed, but after the user clicks the Send button) or when theSendmethod for an Outlook item, such asMailItem, is used in a program.You may also find the the Items.ItemChange event helpful, it is fired when an item in the specified collection is changed.
Another approach is to handle all incoming emails and remove the subject prefix. The NewMailEx event fires when a new message arrives in the Inbox and before client rule processing occurs. You can use the Entry ID returned in the
EntryIDCollectionarray to call the NameSpace.GetItemFromID method and process the item. This event fires once for every received item that is processed by Microsoft Outlook. The item can be one of several different item types, for example,MailItem,MeetingItem, orSharingItem.