locked
Save attachments to hard drive automattically RRS feed

  • Question

  • Is there a way i can save attachments that i get in oulook to a folder that is not in outlook? for example i receive everyday with this as my subject "00083-06EComCC". This email has two attachments. I want to save them in file C:\imports\. If anyone can help me out that would be great. Thank you for the help 
    Wednesday, February 26, 2014 6:38 PM

All replies

  • I got it to work here is the code!

    Public Sub saveAttachtoDisk (itm As Outlook.MailItem)
    Dim objAtt As Outlook.Attachment
    Dim saveFolder As String
    saveFolder = "c:\imports\"
         For Each objAtt In itm.Attachments        
              objAtt.SaveAsFile saveFolder & "\" & objAtt.DisplayName        
              Set objAtt = Nothing    
         Next
    End Sub
    Wednesday, February 26, 2014 7:54 PM
  • Never mind i closed outlook and when i opened it back up it stopped working. Any suggestions?
    Wednesday, February 26, 2014 8:21 PM
  • the code above worked i had to change the security to allow all macros and it ran fine!
    Wednesday, March 5, 2014 3:29 PM