title: Downloaded attachments from Enterprise vault are 0kb in size with only '@' as their name
body: <pre class="lang-vb prettyprint-override"><code>Sub Merge_daily_emails1()
  
      Dim myOlApp As New Outlook.Application
      Dim myNameSpace As Outlook.Namespace
      Dim myInbox As Outlook.MAPIFolder
      Dim Atch As Object
      Set myNameSpace = myOlApp.GetNamespace(&quot;MAPI&quot;)
      Set myInbox = myNameSpace.GetDefaultFolder(olFolderInbox)
      Dim filteredItems As Outlook.Items
      Dim itm As Object
      Dim strFilter As String
  
      strFilter = &quot;@SQL=&quot; &amp; Chr(34) &amp; &quot;urn:schemas:httpmail:subject&quot; &amp; Chr(34) &amp; &quot; like '%Daily Reports%'&quot;
      Set filteredItems = myInbox.Items.Restrict(strFilter)
      AttachmentPath = &quot;H:\&quot;
      If filteredItems.count &gt; 0 Then
          For Each itm In filteredItems
              If itm.Attachments.count &lt;&gt; 0 Then
                  For Each Atch In itm.Attachments
                      Atch.SaveAsFile AttachmentPath &amp; Atch.Filename
                      Exit For
                  Next
              Else
                  MsgBox &quot;Does not Have an Attachment&quot;
              End If
          Next
      End If
      Set myOlApp = Nothing
  
  End Sub
  </code></pre>
  <p>I am trying to download all the attachments from my inbox email which contain the words &quot;daily Report&quot; in their subject line.</p>
  <p>Some Excel files that I download come out to be <strong>0kb in size</strong> and have their name as <strong>&quot;@&quot;</strong>.</p>
  <p>My best guess is that because these emails are old and opened using <strong>enterprise vault</strong> system, I am not able to download the files in a proper way.</p>
  <p>Edit (ddate as Date) argument was the start date I was using for search and I have removed the code to make it simpler, now it will be searching the entire inbox.</p>