Hi Dan,
Welcome to VBAX!![]()
You can use an outlook rule (for incoming mail) to accomplice this. In the rule assign the Macro with "run a script" option in Step 2 off the rule wizard!
The code could look something like this: (insert in Normal code Module)[VBA]
Sub StripSubject(oItem As Outlook.MailItem)
Dim iDelete As Integer
Dim sDelete As String
Dim sOld As String
Dim sNew As String
sDelete = "Hi Dan"
With oItem
sOld = .Subject
iDelete = InStr(1, .Subject, "Hi Dan", vbTextCompare)
If iDelete <> 0 Then
sNew = Replace(sOld, sDelete, "", 1, -1, vbTextCompare)
.Subject = Trim(sNew)
.Save
End If
End With
End Sub
[/VBA]
Enjoy!![]()