Searching Message For Key Words In Outlook
When sending an email, I want to search the recipients of the email as well as the email body for certain key works, and if found, pop up a message to confirm sending.
I am able to get a pop up when the user hits the send key. I'm unable to access the recipient or message objects to search them.
Private Sub Application_ItemSend(ByVal Item As Object, Cancel As Boolean) Dim xPrompt As String Dim xOkOrCancel As Integer On Error Resume Next xPrompt = "Do you want to continue sending the email?" xOkOrCancel = MsgBox(xPrompt, vbOKCancel) If xOkOrCancel <> vbOK Then Cancel = True End If End Sub
I added the following code to try to see the recipient, but it is not returning anything.
Set myAddressEntry = myRecipient.AddressEntry xPrompt = Trim(myAddressEntry) xOkOrCancel = MsgBox(xPrompt, vbOKCancel)