Jump to content

how to save every attachment in every folder to hard drive


Recommended Posts

im close, but not there yet in trying to get this code to work.

i'm trying to get all attachments in every folder to a folder on my hard drive.

would like it to search subfolders of inbox along with folders that could have been created along side with the inbox, sent ect ect

here is my code so far

Sub Getatth() 
Set MAPI = Outlook.GetNamespace("MAPI")
Set TopFolder = MAPI.Folders.Item("Mailbox - John Doe")
Set InboxFolder = TopFolder.Folders.Item("Inbox")

For Each myItem In InboxFolder.Items
For Each att In myItem.Attachments
att.SaveAsFile "C:\attch\" & att.FileName
Next
Next

End Sub

Link to comment
Share on other sites


Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...