DanTGK1
04-13-2015, 08:37 AM
Hi
I am trying to write a macro that deletes certain text if I am replying to specific address.
The signature from the sender contains phone numbers that our mail system thinks is a credit card number and therefore blocks it.
This is what I have tried but it errors and I think it is because I have the 'Recipient' bit wrong. Probably doesn't exist but I cannot find the equivalent.
I hope that it will check 'cc' an 'to' lines.
Private Sub Application_ItemSend(ByVal Item As Object, Cancel As Boolean)
Set myItem = Application.CreateItem(olMailItem)
If myItem.Recipient = "mail address here" Then
myItem.Body = Replace(outMailItem.Body, "Phone : +44 (0) 123 45 6789" & _
vbNewLine & "Mobile : +44 (0) 9 8765 4321", "")
End If
End Sub
Thanks
I am trying to write a macro that deletes certain text if I am replying to specific address.
The signature from the sender contains phone numbers that our mail system thinks is a credit card number and therefore blocks it.
This is what I have tried but it errors and I think it is because I have the 'Recipient' bit wrong. Probably doesn't exist but I cannot find the equivalent.
I hope that it will check 'cc' an 'to' lines.
Private Sub Application_ItemSend(ByVal Item As Object, Cancel As Boolean)
Set myItem = Application.CreateItem(olMailItem)
If myItem.Recipient = "mail address here" Then
myItem.Body = Replace(outMailItem.Body, "Phone : +44 (0) 123 45 6789" & _
vbNewLine & "Mobile : +44 (0) 9 8765 4321", "")
End If
End Sub
Thanks