title: Identify MS Excel or MS Access attachments and warn to check contents
body: <p>Personal identifying information (PII) is often inadvertently transmitted through non-encrypted emails.  Most of the times these data are stored in Excel or Access spreadsheets.  </p>
  
  <p>I'd like to identify Access or Excel attachments after hitting send and ask "There are Access or Excel files attached to this email, are you sure these do not contain PII?"</p>
  
  <p>The criteria for identifying "xlsx" or "accdb" in the attachment name I just don't get.</p>
  
  <pre><code>Private Sub Application_ItemSend(ByVal Item As Object, Cancel As Boolean)
  
  If Right([attachment_Name],4) = xlsx then
  
      answer = MsgBox("There are Access or Excel files attached to this email, are you sure these do not contain PHI?",vbYesNo)
  
      If answer = vbNo 
          Cancel = True
      Else
  
      End If
  
  End If
  
  End Sub
  </code></pre>