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: 31.066  | #136
◀ Previous sample Next sample ▶
SAM SAM
Determine the "identity" of your emails. Set with SAM the sender and the folder folder for sent items with the help of rules.

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
Reporter Reporter
VBOffice Reporter is an easy to use tool for data analysis and reporting in Outlook. A single click, for instance, allows you to see the number of hours planned for meetings the next month.
email  Send a message