Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Private Sub Application_ItemSend(ByVal Item As Object, Cancel As Boolean)
Dim prompt As String
Dim FoundWords As String
Dim Body As String
Dim MailItem As Outlook.MailItem
Dim BadWords As Collection
Dim i As Integer
If TypeOf Item Is Outlook.MailItem Then
Set MailItem = Item
Body = MailItem.Body
Set BadWords = GetWords
For i = 1 To GetWords.Count
If InStr(Body, GetWords(i)) <> 0 Then
FoundWords = FoundWords & ", " & GetWords(i)
End If
Next i
If Not FoundWords = "" Then
prompt = "Are you sure you want to send " & Item.Subject & "? It contains: " & FoundWords
If MsgBox(prompt, vbYesNo + vbQuestion, "Sample") = vbNo Then
Cancel = True
End If
End If
End If
End Sub
Public Function GetWords() As Collection
Dim colWords As New Collection
'add all your words here
colWords.Add "Dog"
colWords.Add "Cat"
colWords.Add "Money"
colWords.Add "!@#$"
'....
Set GetWords = colWords
End Function