Nothing about Outlook. Waste of time.
How to save all attachments from multiple emails to folder in Outlook?
As usual, when you receive messages with multiple attachments and you want to save these attachments to a specific folder, you need to save them one by one with some annoying operations. Do you want to get rid of that time-consuming operations and directly save the multiple attachments at once? Please look at the following tutorials.
Office Tab: Enable Tabbed Editing and Browsing in Office, Just Like Chrome, Firefox, IE 8/9/10.
Classic Menu: Bring Old Menus and Toolbars Back to Office 2007, 2010, 2013, 2016 and 2019.
1. Firstly, you should create a folder for saving the attachments in your computer. The saving path just like the following screenshot shows, Lj is the user name of the computer, and the Attachments is the folder which you should finally create.
2. After creating the folder, press Alt + F11 to open the Microsoft Visual Basic for Applications window.
3. Then click Insert > Module to open the Module window, and then copy and paste the following VBA code to the window.
VBA code for saving attachments
Public Sub SaveAttachments() 'Update 20141121 Dim objOL As Outlook.Application Dim objMsg As Outlook.MailItem Dim objAttachments As Outlook.Attachments Dim objSelection As Outlook.Selection Dim i As Long Dim lngCount As Long Dim strFile As String Dim strFolderpath As String Dim strDeletedFiles As String strFolderpath = CreateObject("WScript.Shell").SpecialFolders(16) Set objOL = CreateObject("Outlook.Application") Set objSelection = objOL.ActiveExplorer.Selection strFolderpath = strFolderpath & "\Attachments\" For Each objMsg In objSelection Set objAttachments = objMsg.Attachments lngCount = objAttachments.Count strDeletedFiles = "" If lngCount > 0 Then For i = lngCount To 1 Step -1 strFile = objAttachments.Item(i).FileName strFile = strFolderpath & strFile objAttachments.Item(i).SaveAsFile strFile 'objAttachments.Item(i).Delete() If objMsg.BodyFormat <> olFormatHTML Then strDeletedFiles = strDeletedFiles & vbCrLf & "<Error! Hyperlink reference not valid.>" Else strDeletedFiles = strDeletedFiles & "<br>" & "<a href='file://" & _ strFile & "'>" & strFile & "</a>" End If Next i If objMsg.BodyFormat <> olFormatHTML Then objMsg.Body = vbCrLf & "The file(s) were saved to " & strDeletedFiles & vbCrLf & objMsg.Body Else objMsg.HTMLBody = "<p>" & "The file(s) were saved to " & strDeletedFiles & "</p>" & objMsg.HTMLBody End If objMsg.Save End If Next ExitSub: Set objAttachments = Nothing Set objMsg = Nothing Set objSelection = Nothing Set objOL = Nothing End Sub
Note: This VBA code will permanently remove the attachment from the email.
4. Go to Outlook Mail section to select the emails with attachments which you want to save the attachments.
5. Return to the Microsoft Visual Basic for Applications window, and click button to run the code.
6. When a prompt box showing up, click Allow to save the attachment. Note: The prompt box’s showing frequencies depend on how many emails you have selected. If you have selected two emails with attachments, the prompt box will show up twice and you need to click Allow twice to finish all savings.
7. After finish all savings, you will see the result as shown in the below screenshots. You can go to find the saved attachments according to the saving path or open the attachment directly by just click on the saving path.
This section will introduce the Detach All utility of Kutools for Outook. With this utility, you can quickly save attachments from multiple emails at once in Outlook.
1. Get into the email folder and select the multiple emails with attachments in mail list by holding the Ctrl key.
2. Then click Kutools > Detach All. See screenshot:
3. Then a Please select a folder dialog box pops up, please click the Browse button to select a folder to save the detached attachments, check the Create subfolders in he following style box, and then specify a folder style from the drop-down list. Finally click the OK button. See screenshot:
4. In the opening Detach All dialog box, please click the Yes button.
5. Then a Kutools for Outlook dialog box displays to tell you how many attachments are detached successfully, please click the OK button:
If you want to have a free trial of this utility, please go to free download the software first, and then go to apply the operation according above steps.
Kutools for Outlook includes 20+ powerful features and tools for Microsoft Outlook. Free to try with no limitation in 45 days. Download the free trial now!
- How to remove all attachments from email in Outlook?
- How to keep attachments when replying in Outlook?
- How to rename attachments in Outlook window without saving to disc?
Recommended Productivity Tools
- Complicated and repeated operations can be done a one-time processing in seconds.
- Forward multiple emails individually with one-click, and auto forward by rules.
- Auto CC/BCC every sending email and easy for customizing rules, and auto reply without requiring exchange server.
- Powerful junk emails filter, remove duplicate emails, reply with attachment, bunch of one-click operations, and so on...
- 60-day unlimited free trial. 60-day money back guarantee. 2 years free upgrade and support. Buy once, use forever.
You are guest ( Sign Up? )
or post as a guest, but your post won't be published automatically.
To post as a guest, your comment is unpublished.· 1 months agoSo I click the link "Kutools for outlook" and I'm directed to a page that is not that, but "Kutools - Combines More Than 300 Advanced Functions and Tools for Microsoft Excel."
Nothing about Outlook. Waste of time.
To post as a guest, your comment is unpublished.· 2 years agoThis is what the code is at now, and it does save all the attachments, but it only adds text to the first message. Can anyone help me with this?
Public Sub SaveAttachments()
Dim objOL As Outlook.Application
Dim objMsg As Outlook.MailItem
Dim objAttachments As Outlook.Attachments
Dim objSelection As Outlook.Selection
Dim I As Long
Dim lngCount As Long
Dim strFile As String
Dim strFolderpath As String
Set objOL = CreateObject("Outlook.Application")
Set objSelection = objOL.ActiveExplorer.Selection
strFolderpath = "C:\Users\brianp\Documents\Attachments\"
For Each objMsg In objSelection
Set objAttachments = objMsg.Attachments
lngCount = objAttachments.Count
'Use this to test MsgBox "Subject = " & objMsg.Subject & " lngCount = " & objAttachments.Count
If lngCount > 0 Then
For I = lngCount To 1 Step -1
strFile = objAttachments.Item(I).FileName
strFile = strFolderpath & strFile
If objMsg.BodyFormat olFormatHTML Then
objMsg.Body = vbCrLf & "The Attached file(s) were saved to " & "" & strFile & "" & vbCrLf & objMsg.Body
objMsg.HTMLBody = "" & "The Attached file(s) were saved to " & "" & strFile & "" & "" & objMsg.HTMLBody
Set objAttachments = Nothing
Set objMsg = Nothing
Set objSelection = Nothing
Set objOL = Nothing
To post as a guest, your comment is unpublished.· 2 years agoI can get this to run but how and the objSelection.Count is 2 but it will only save the attachments on the first email.
To post as a guest, your comment is unpublished.· 2 years agoThanks! This saved me a lot of time and frustration!
To post as a guest, your comment is unpublished.· 2 years agoWorks great with no problems! Thanks. Saved me a bunch of time!