From http://www.slipstick.com/how-to-outl...email-address/
"This macro checks messages for one specific address and if it finds the address, allows you to cancel the send. On Error Resume Next allows it to work with meetings or task requests, otherwise it kicks up an error message."
Private Sub Application_ItemSend(ByVal Item As Object, Cancel As Boolean)
On Error Resume Next
' use lower case for the address
' LCase converts all addresses in the To field to lower case
If InStr(LCase(Item.To), "[email protected]") Then
Prompt$ = "You sending this to " & Item.To & ". Are you sure you want to send it?"
If MsgBox(Prompt$, vbYesNo + vbQuestion + vbMsgBoxSetForeground, "Check Address") = vbNo Then
Cancel = True
End If
End If
End Sub
To make this work for you "[email protected]" becomes "@publicdomain.com"
Private Sub Application_ItemSend(ByVal Item As Object, Cancel As Boolean)
On Error Resume Next
' use lower case for the address
' LCase converts all addresses in the To field to lower case
If InStr(LCase(Item.To), "@publicdomain.com") Then
Prompt$ = "Sending to @publicdomain.com will be cancelled."
MsgBox Prompt$
Cancel = True
End If
End Sub
This macro needs to be added to ThisOutlookSession to work.
Bookmarks