Script to remove overly-long external email notification
I'm using this at the moment, and it works but it also strips all in-line images from the body which is not ok.
Is there a way to remove only this text at the top of the email but not break the formatting or contents of the rest of the email?
Code:
Sub ShrinkAlert(MyMail As MailItem)
Dim body As String, re As Object, match As Variant
body = MyMail.body
body = Replace(body, "CAUTION! This is an EXTERNAL email originated from outside the organization. Do not click links or open attachments unless you recognize the sender and know the content is safe. ", "EXTERNAL:", 1, -1, vbTextCompare)
MyMail.body = body
MyMail.Save
End Sub
My source info:
Replace Text: https://superuser.com/questions/4640...rlink-in-outlo
Enable Run Script rule: https://www.slipstick.com/outlook/ru...-script-rules/
Allow Macros: https://www.techrepublic.com/article...0(Figure%20A).