Hello all and many thanks for all past help! I have a macro I am using that removed EXTERNAL from incoming emails. This is a new feature that is causing issues with other things and I need to remove it. I have a code that works just about exactly as I need. The only drawback is that is changes everything to lower case. I would like for this to retain the case as it is when the email is received. One thing I don't understand, but it isn't affecting the functionality of the macro, is that when the message box appears, it says 0 of ## when it obviously did update the subject lines. Not sure why that is... Any suggestions would be most appreciated. Here is the code I am currently using (picked up from another forum).
VBA Code:
Sub RemoveExternalString()
Dim myolApp As Outlook.Application
Dim Item As Object
Set myolApp = CreateObject("Outlook.Application")
Set mail = myolApp.ActiveExplorer.CurrentFolder
' Remove from left or right
Dim iItemsUpdated As Integer
Dim lString As Integer
iItemsUpdated = 0
For Each Item In mail.Items
strSubject = LCase(Item.Subject)
If InStr(1, strSubject, "[external]") Then
Item.Subject = Replace(strSubject, "[external] ", "")
Item.Save
End If
Next Item
MsgBox iItemsUpdated & " of " & mail.Items.Count & " Messages Updated"
Set myolApp = Nothing
End Sub