VBOffice

Remove Text From Email Subject

This script clears the subject of an email and removes any phrase you want.

Last modified: 2015/02/13 | Accessed: 14.858  | #136
◀ Previous sample Next sample ▶
OLKeeper OLKeeper
OLKeeper reliably prevents users from closing their Outlook window and thus possibly missing reminders or e-mails.

If an email is sent back and forth, it happens that the subject becomes longer and longer. When replying or forwarding, an email client often doesn't recognize that the acronym 'RE:', or 'FWD:' is already prefixed and puts it in front of the subject in your language without removing the other acronym. The opposite party then does the same, and so forth.

The following script can be called by the Rule Assistent. Simply add the phrases you want to be removed to the array. Each phrase must be in quotation marks.


tip  How to add macros to Outlook
Public Sub ClearSubject(Item As Outlook.MailItem)
  Dim arr As Variant, i As Long
  
  'List of phrases to be removed
  arr = Array("RE:", "AW:")
  
  For i = 0 To UBound(arr)
    Item.Subject = Replace(Item.Subject, arr(i), , "", , vbTextCompare)
  Next
  If Item.Saved = False Then
    Item.Subject = Trim$(Item.Subject)
    Item.Save
  End If
End Sub
Category-Manager Category-Manager
With Category-Manager you can group your Outlook categories, share them with other users, filter a folder by category, automatically categorize new emails, and more. You can use the Addin even for IMAP.
email  Send a message