Phillip
Member
- Outlook version
- Email Account
- POP3
Hi,
I need a macro that will delete various text phrases that get inserted into the subject line of email.
Text phases like: , RE: , UNCLASS, FW: , Fwd, and several more.
I found a macro on this website (cannot remembber the author) that will remove a single occurrence of a text phrase. In this case the macro removes the phrase "RE: " from the subject line.
'Code to Remove string "RE1:_" from subject line - RE1: with single space
Sub StripSubjectRE1(oItem As Outlook.MailItem)
Dim iDeleteRE1 As Integer
Dim sDeleteRE1 As String
Dim sOldRE1 As String
Dim sNewRE1 As String
iDeleteRE1 = 0
sDeleteRE1 = "RE: "
With oItem
sOldRE1 = .Subject
iDeleteRE1 = InStr(1, .Subject, sDeleteRE1, vbTextCompaRE1)
If iDeleteRE1 <> 0 Then
sNewRE1 = Replace(sOldRE1, sDeleteRE1, "", 1, -1, vbTextCompare)
.Subject = Trim(sNewRE1)
.Save
End If
End With
End Sub
I would like a single macro that will handle a list of several text phrases.
Can anyone help me with this?
Thanks,
Phil
I need a macro that will delete various text phrases that get inserted into the subject line of email.
Text phases like: , RE: , UNCLASS, FW: , Fwd, and several more.
I found a macro on this website (cannot remembber the author) that will remove a single occurrence of a text phrase. In this case the macro removes the phrase "RE: " from the subject line.
'Code to Remove string "RE1:_" from subject line - RE1: with single space
Sub StripSubjectRE1(oItem As Outlook.MailItem)
Dim iDeleteRE1 As Integer
Dim sDeleteRE1 As String
Dim sOldRE1 As String
Dim sNewRE1 As String
iDeleteRE1 = 0
sDeleteRE1 = "RE: "
With oItem
sOldRE1 = .Subject
iDeleteRE1 = InStr(1, .Subject, sDeleteRE1, vbTextCompaRE1)
If iDeleteRE1 <> 0 Then
sNewRE1 = Replace(sOldRE1, sDeleteRE1, "", 1, -1, vbTextCompare)
.Subject = Trim(sNewRE1)
.Save
End If
End With
End Sub
I would like a single macro that will handle a list of several text phrases.
Can anyone help me with this?
Thanks,
Phil