title: Find out if an attachment is embedded or attached
body: <p>I am coding a small VBA to show all attachments of an email in a list box.</p>
  
  <p>The user can select attachments that should be removed from the email and stored on a target folder.</p>
  
  <p>I am also adding a HTML file to the email that contains a list of all removed files (including a link to each file to the target folder).</p>
  
  <p>I have a problem with images, because they can be</p>
  
  <ul>
  <li>Attached as a normal file to the email</li>
  <li>Embedded to the email body (like a company logo in the signature)</li>
  </ul>
  
  <p>I want to show in my list box only those images, that are attached as files to the email.</p>
  
  <p>Embedded mails should be ignored.</p>
  
  <pre><code>Sub SaveAttachment()
  
      Dim myAttachments           As Outlook.Attachments
      Dim olMailItem              As Outlook.MailItem
      Dim lngAttachmentCount      As Long
      Dim Attachment_Filename     As String
  
      Select Case True
  
          Case TypeOf Application.ActiveWindow Is Outlook.Inspector
              Set olMailItem = Application.ActiveInspector.CurrentItem
          Case Else
  
          With Application.ActiveExplorer.Selection
              If .Count Then Set olMailItem = .Item(1)
          End With
  
          If olMailItem Is Nothing Then Exit Sub
  
      End Select
  
      Set myAttachments = olMailItem.Attachments
  
      If myAttachments.Count &gt; 0 Then
  
          For lngAttachmentCount = myAttachments.Count To 1 Step -1
  
              '-------------------------------------------------------------------------
              ' Add the attachment to the list of attachments (form)
              '-------------------------------------------------------------------------
              Attachment_Filename = myAttachments(lngAttachmentCount).FileName
  
              With UserForm1.lstAttachments
  
                  .AddItem (Attachment_Filename)
                  .List(lngAttachmentListPos, 1) = Attachment_Type_Text
                  .List(lngAttachmentListPos, 2) = FormatSize(myAttachments(lngAttachmentCount).Size) &amp; " KB"
  
              End With
  
          Next lngAttachmentCount
  
      End If
  
  End Sub
  </code></pre>
  
  <p>I added only the relevant parts of the code, so I hope I have not forgotten anything.</p>
  
  <p>At the moment I show all attachments (also embedded images).</p>
  
  <p>How would I find out if an attachment is embedded?</p>
  
  <p>I found a possible solution here:
  <a href="https://stackoverflow.com/questions/12310925/distinguish-visible-and-invisible-attachments-with-outlook-vba">Distinguish visible and invisible attachments with Outlook VBA</a><br>
  The source code provided is not working, it seems like the two URLs in line 2 and 3 no longer exist.</p>