title: How to Count total number of attachments in outlook
body: <p>I was actually going through the below code for counting the attachments from selected emails.</p>
  
  <pre><code>    Sub CountAttachmentsinSelectedEmails()
      Dim olSel As Selection
      Dim oMail As Object
      Dim AttCount As Long
      Dim strMsg As String
  
      Set olSel = Outlook.Application.ActiveExplorer.Selection
  
      For Each oMail In olSel
          'To confirm if the selected items are all emails
          If oMail.Class &lt;&gt; olMail Then
             strMsg = "Please select mail items only!"
             nRes = MsgBox(strMsg, vbOKOnly + vbExclamation)
             Exit Sub
          End If
          'Get the total number of the attachments in selected emails
          AttCount = oMail.Attachments.Count + AttCount
      Next
  
      strMsg = "There are " &amp; AttCount &amp; " attachments in the " &amp; olSel.Count &amp; " selected emails."
      nRes = MsgBox(strMsg, vbOKOnly + vbInformation, "Count Attachments")
  End Sub
  </code></pre>
  
  <p>But this is actually considering the logo in signature and any embedded or inserted pictures in email body and showing the wrong result.</p>
  
  <p>So, here I need help on below two questions:</p>
  
  <ol>
  <li><p>Is there any way to skip them ?</p></li>
  <li><p>Is there any code for counting the total documents in a zip or rar file attachment in the email ?</p></li>
  </ol>
  
  <p>If there is any code, can we include that here ?</p>