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: 32.476  | #136
◀ Previous sample Next sample ▶
ReplyAll ReplyAll
ReplyAll alerts you before unintentionally replying all, or if you are a confidential BCC recipient of the e-mail.

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
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.
email  Send a message