Tip: Other languages are Google-Translated. You can visit the English version of this link.
Log in
x
or
x
x
Register
x

or

如何在Outlook裡批量保存多封郵件裡的附件?

通常,點擊郵件裡的附件啟動附件選項卡後,你可以點擊保存所有附件按鈕保存當前郵件的附件。如果需要保存多封郵件的附件,只能一一操作。如果需要一次性地保存多封郵件裡的附件,你可以試試下面的方法:

Kutools for Outlook: 100+ New Advanced Tools for Outlook.
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.

arrow blue right bubble 運行VBA將多封郵件中的附件批量保存到資料夾中

1. 首先,在電腦裡創建一個將要保存附件的資料夾。資料夾路徑應如下圖所示:MarsPC是windows用戶名,Attachments為資料夾名。

2. 創建資料夾後,回到Outlook介面,按住鍵盤上的Alt 和F11鍵打開Microsoft Visual Basic for Applications視窗。

3. 點擊插入 > 模組打開模組視窗,然後將下面VBA代碼粘貼到新打開的模組視窗裡。

VBA:在Outlook裡保存所有附件

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

4. 打開Outlook的郵件視圖,選中帶附件郵件。

5. 返回Microsoft Visual Basic for Applications視窗,點擊運行按鈕(或者點擊F5鍵)運行代碼。

6. 當下圖所示對話方塊彈出時,點擊Allow按鈕。

注意:該對話方塊的彈出次數跟選中的郵件數量一致。比如,你選中了兩封帶附件的郵件,該對話方塊將彈出兩次,你需要點擊Allow按鈕兩次完成操作。

7. 所有附件保存成功後,最後的保存結果如下圖所示。你可以點擊對應的保存路徑找到已保存的附件。


arrow blue right bubble 運行Kutools for Outlook快速地將多封郵件中的附件保存到資料夾中

Kutools for Outlook的拆離所有功能可以幫你在Outlook裡快速地保存多封郵件裡的附件。

Kutools for Outlook - 讓你在 Outlook 裡的工作更簡單、更快捷!批量保存/壓縮附件、高級列印、自動答覆\轉發\攔截垃圾郵件、刪除重複項,等等……

1. 打開郵件資料夾,在郵寄清單裡選擇多封帶附件的郵件。

2. 點擊Kutools > 其他功能 > 拆離所有。見下圖:

3. 在拆離所有對話方塊裡,點擊

現在,所選郵件裡的附件都被拆離並保存到指定資料夾中。

注意:第一次運行該功能時,點擊Kutools > 其他功能 > 拆離所有後會彈出流覽資料夾對話方塊,你需要在此對話方塊裡指定保存附件的資料夾。

點擊下載 Kutools for Outlook, 45天無限制免費試用!

 

Recommended Productivity Tools

shot kutools outlook kutools tab 1180x121
shot kutools outlook kutools plus tab 1180x121

Kutools for Outlook - More than 100 Advanced Functions for Outlook, Improve 70% Efficiency For you

  • 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.
Say something here...
symbols left.
You are guest ( Sign Up? )
or post as a guest, but your post won't be published automatically.
Loading comment... The comment will be refreshed after 00:00.

Be the first to comment.