It can be quite dangerous and insecure if you send any emails which contain your private information. Therefore, this post will introduce you a method which can let Outlook prompt you before you sending such emails.
Nowadays, potential security threats are all around. Thus, we should make a lot of efforts to safeguard our own private information, such as credit cards, various account passwords and other sensitive info, etc. Hence, you should pay attention to your daily online behaviors, including communications in MS Outlook.
More specifically, you should keep cautious when sending emails to prevent any of your private information from being leaked through emails. In this case, maybe you will desire that Outlook can automatically prompt you before you send mails that contain your private information. In the followings, we will guide you how to realize it via VBA.
Get a Confirmation before Sending Emails with Your Private Information
- At the very outset, you have to specify your private information. As I usually stores all of my private information in an Excel file, I’ll take it an instance, like the following screenshot:
- If you’ve kept such an Excel file, you can start your Outlook application.
- Then press “Alt + F11” key buttons in main Outlook window.
- Next find and open the “ThisOutlookSession” project in Outlook VBA editor.
- Subsequently, copy the following VBA codes into this project window.
Private Sub Application_ItemSend(ByVal objItem As Object, Cancel As Boolean) Dim strItemBody As String Dim strExcelFile As String Dim objExcelApp As Excel.Application Dim objExcelWorkbook As Excel.Workbook Dim objExcelWorksheet As Excel.Worksheet Dim nRow, nColumn As Integer Dim strSensitiveInfo As String Dim strMsg As String Dim nResponse As Integer strItemBody = objItem.Body 'Specify the source Excel file strExcelFile = "E:\MyPrivacy.xlsx" On Error Resume Next Set objExcelApp = CreateObject("Excel.Application") Set objExcelWorkbook = objExcelApp.Workbooks.Open(strExcelFile) Set objExcelWorksheet = objExcelWorkbook.Sheets("Privacy") nRow = 1 nColumn = 1 Do While objExcelWorksheet.Cells(nRow, nColumn) <> "" strSensitiveInfo = objExcelWorksheet.Cells(nRow, nColumn) 'Check if the email body contains the private information If InStr(strItemBody, strSensitiveInfo) > 0 Then strMsg = "The current item contains sensitive information. Do you still want to send it?" nResponse = MsgBox(strMsg, vbExclamation + vbYesNo, "Check Sensitive Information") If nResponse = vbYes Then Cancel = False Else Cancel = True End If Exit Do End If nRow = nRow + 1 nColumn = nColumn + 1 Loop End Sub
- After that, sign this code and change your Outlook macro settings.
- From now on, every time when you send emails, Outlook will auto check if its body contain any information of the Excel file.
- If it contains, you will get a confirmation like the image below:
- If you select “Yes”, the email will be sent out as usual. Otherwise, the sending will be canceled.
Safeguard Your Valuable PST Data
Due to the fact that Outlook is vulnerable, it is an arduous task to defend your PST data. Firstly, you have to persist in making regular backups for your PST file. In addition, you need to keep a potent and well-proven PST repair tool handy, like DataNumen Outlook Repair.
Author Introduction:
Shirley Zhang is a data recovery expert in DataNumen, Inc., which is the world leader in data recovery technologies, including mdf fix and outlook repair software products. For more information visit www.datanumen.com