title: Outlook VBA - Save Attachments and Email separately
body: <p>User will select an Email and I need to save all its attachments to a folder + that Email without attachment in a separate folder.</p>
  
  <p>I have written code and it seems to be working fine except one big issue:</p>
  
  <p><strong>Attachments are removed from original email also from my Inbox. After removing attachments I am calling SaveAs method so I think this should not happen.</strong></p>
  
  <p>Here is the code I have written:</p>
  
  <pre><code> Dim objMailItemOriginal As Outlook.MailItem
      Dim objMailItemNew As Outlook.MailItem
      Dim objNameSpaceUserNS As Outlook.namespace
      Dim emailPath$, tmpFolder$
  
      Set objMailItemOriginal = Application.ActiveExplorer.Selection(1)
      Set objMailItemNew = Application.CreateItem(olMailItem)
      Set objNameSpaceUserNS = Application.GetNamespace("MAPI")
  
      tmpFolder = Environ("Temp") &amp; "\" &amp; Format$(Now, "hh_mm_ss")
      MkDir tmpFolder
  
      emailPath = Environ$("Temp") &amp; "\tmpEmail.msg"
  
      Dim attachPath$
      For i = objMailItemOriginal.Attachments.Count To 1 Step -1
          attachPath = tmpFolder &amp; "\" &amp; objMailItemOriginal.Attachments(i)
          objMailItemOriginal.Attachments(i).SaveAsFile attachPath
  
          objMailItemNew.Attachments.Add attachPath
          objMailItemOriginal.Attachments.Remove (i)
      Next
  
      objMailItemOriginal.SaveAs emailPath
      objMailItemOriginal.Close olDiscard
  </code></pre>
  
  <p>Any outlook expert please?</p>