跳到主要內容

如何在Outlook中以一封/多封電子郵件打印所有附件?

如您所知,當您單擊電子郵件時,它將僅打印電子郵件內容,例如標題,正文 文件 > 列印 在Microsoft Outlook中,但不打印附件。 在這裡,我們將向您展示如何在Microsoft Outlook中輕鬆打印所選電子郵件中的所有附件。


一張一張打印一封電子郵件中的所有附件

Microsoft Outlook為我們提供了 快速打印 功能,可以幫助您一一打印電子郵件中的附件。

1。 選擇您稍後將打印附件的電子郵件。

2。 單擊此電子郵件中的一個附件。

3。 點擊 快速打印 按鈕在 動態 組上 附件 標籤。

注意: 附件工具 在您單擊電子郵件中的附件之前,不會激活它。

4. 出現打開郵件附件對話框,請單擊 已提交 按鈕。

請注意,此步驟將打開選定的附件,並同時打印此選定的附件。

要打印此電子郵件中的其他附件,請重複步驟2至步驟4。

在Outlook中快速保存/導出多封電子郵件中的所有附件

通常,我們可以通過激活以下電子郵件來保存一封電子郵件中的附件 附件工具 並應用 保存所有附件 Outlook中的功能。 但是,如果從多封電子郵件或Outlook中的整個郵件文件夾中保存附件怎麼辦? 嘗試使用Kutools for Outlook的 保存全部 (附件)功能。


將附件保存在多封電子郵件中kto9

批量打印一封電子郵件中的所有附件

如果一封電子郵件中有很多附件,則要逐個打印它們會很耗時。 以下方法將引導您輕鬆批量打印所選電子郵件中的所有附件。

1。 選擇您稍後將打印附件的電子郵件。

2。 在Outlook 2010或更高版本中,請單擊 文件 > 列印 > 列印選項。 請參見以下屏幕截圖:

3. 在打印對話框中,請檢查 打印附件。 附件將僅打印到默認打印機 在選項 打印選項 部分。

4。 點擊 列印 按鈕。

5。 在彈出的打開郵件附件對話框中,請單擊 已提交 按鈕繼續。 (備註:此對話框將分別為每個附件彈出。)

現在將立即打印此選定電子郵件中的所有附件。


批量打印多個選定電子郵件中的所有附件和圖片

要在 Outlook 中打印多封電子郵件中的所有附件以及郵件正文中的所有圖片,請按照以下步驟應用 VBA 代碼。

1。 在郵件列表中,請按住 按Ctrl or 轉移 鍵選擇要打印附件的多封電子郵件。

2。 按 其他 + F11 鍵一起打開Microsoft Visual Basic for Applications窗口。

3。 在“ Microsoft Visual Basic for Applications”窗口中,單擊“ 工具 > 參考。 然後檢查 Microsoft腳本運行時 選項如下圖。 完成後,單擊 OK.

4。 點擊 插入 > 模塊,然後將以下VBA代碼粘貼到新的模塊窗口中。

VBA:打印多封Outlook電子郵件中的所有附件

Sub PrintAllAttachmentsInMultipleMails()
  'Update by ExtendOffice 2022/08/03
  Dim xShellApp As Object
  Dim xFSO As Scripting.FileSystemObject
  Dim xItem As Object
  Dim xTempFldPath, xFilePath As String
  Dim xSelItems As Outlook.Selection
  Dim xMailItem As Outlook.MailItem
  Dim xAttachments As Outlook.Attachments
  Dim xAttachment As Outlook.Attachment
  Dim xFile As File
  On Error Resume Next
  Set xFSO = New Scripting.FileSystemObject
  xTempFldPath = xFSO.GetSpecialFolder(2).Path & "\Attachments " & Format(Now, "yyyymmddhhmmss") 'xFSO.GetSpecialFolder(2) For saving temporary files
  If xFSO.FolderExists(xTemfldpath) = False Then 'create temporary folder
    xFSO.CreateFolder (xTempFldPath)
  End If
  Set xSelItems = Outlook.ActiveExplorer.Selection
  Set xShellApp = CreateObject("Shell.Application")
  For Each xItem In xSelItems
    If xItem.Class = OlObjectClass.olMail Then
      Set xMailItem = xItem
      Set xAttachments = xMailItem.Attachments
      For Each xAttachment In xAttachments
        xFilePath = xTempFldPath & "\" & xAttachment.FileName
        xAttachment.SaveAsFile (xFilePath)
      Next
    End If
  Next
  For Each xFile In xFSO.GetFolder(xTempFldPath).Files
    VBA.DoEvents
    Call xShellApp.ShellExecute(xFile.Path, "", "", "print", 0)
  Next
  Set xSelItems = Nothing
  Set xShellApp = Nothing
  Set xFSO = Nothing
End Sub

5。 按 F5 鍵或單擊 按鈕運行此 VBA 代碼。 現在您將看到所選電子郵件中的所有附件和消息正文中的圖片都已打印出來。

注意:

  • 每個圖像都會彈出一個對話框,要求您確認打印。 而其他類型的文件將直接打印。
  • 如果電子郵件簽名中有圖像,它們也會彈出對話框。
  • 如果你得到 此項目中的宏已禁用 錯誤,請查看本教程: 如何在 Outlook 中啟用和禁用宏?

批量打印多個選定電子郵件中的所有附件,正文中的圖片除外

要在 Outlook 中僅打印多封電子郵件中的附件,而在郵件正文中打印圖片,請按照以下步驟應用 VBA 代碼。

1。 在郵件列表中,請按住 按Ctrl or 轉移 鍵選擇要打印附件的多封電子郵件。

2。 按 其他 + F11 鍵一起打開Microsoft Visual Basic for Applications窗口。

3。 在“ Microsoft Visual Basic for Applications”窗口中,單擊“ 工具 > 參考。 然後檢查 Microsoft腳本運行時 選項如下圖。 完成後,單擊 OK.

4。 點擊 插入 > 模塊,然後將以下VBA代碼粘貼到新的模塊窗口中。

VBA:打印多封Outlook電子郵件中的所有附件

Sub PrintAllAttachmentsInMultipleMails()
  'Update by ExtendOffice 2022/08/05
  Dim xShellApp As Object
  Dim xFSO As Scripting.FileSystemObject
  Dim xItem As Object
  Dim xTempFldPath, xFilePath As String
  Dim xSelItems As Outlook.Selection
  Dim xMailItem As Outlook.MailItem
  Dim xAttachments As Outlook.Attachments
  Dim xAttachment As Outlook.Attachment
  Dim xFile As File
  On Error Resume Next
  Set xFSO = New Scripting.FileSystemObject
  xTempFldPath = xFSO.GetSpecialFolder(2).Path & "\Attachments " & Format(Now, "yyyymmddhhmmss") 'xFSO.GetSpecialFolder(2) For saving temporary files
  If xFSO.FolderExists(xTemfldpath) = False Then 'create temporary folder
    xFSO.CreateFolder (xTempFldPath)
  End If
  Set xSelItems = Outlook.ActiveExplorer.Selection
  Set xShellApp = CreateObject("Shell.Application")
  For Each xItem In xSelItems
    If xItem.Class = OlObjectClass.olMail Then
      Set xMailItem = xItem
      Set xAttachments = xMailItem.Attachments
      For Each xAttachment In xAttachments
        If IsEmbeddedAttachment(xAttachment) = False Then
          xFilePath = xTempFldPath & "\" & xAttachment.FileName
          xAttachment.SaveAsFile (xFilePath)
          Debug.Print xFilePath
        End If
      Next
    End If
  Next
  For Each xFile In xFSO.GetFolder(xTempFldPath).Files
    VBA.DoEvents
    Call xShellApp.ShellExecute(xFile.Path, "", "", "print", 0)
  Next
  Set xSelItems = Nothing
  Set xShellApp = Nothing
  Set xFSO = Nothing
End Sub

Function IsEmbeddedAttachment(Attach As Attachment)
Dim xItem As MailItem
Dim xCid As String
Dim xID As String
Dim xHtml As String
On Error Resume Next
IsEmbeddedAttachment = False
Set xItem = Attach.Parent
If xItem.BodyFormat <> olFormatHTML Then Exit Function
xCid = ""
xCid = Attach.PropertyAccessor.GetProperty("http://schemas.microsoft.com/mapi/proptag/0x3712001F")
If xCid <> "" Then
    xHtml = xItem.HTMLBody
    xID = "cid:" & xCid
    If InStr(xHtml, xID) > 0 Then
        IsEmbeddedAttachment = True
    End If
End If
End Function

5。 按 F5 鍵或單擊 按鈕運行此 VBA 代碼。 現在您將看到所選電子郵件中的所有附件都已打印出來。

注意:

  • 每個附加的圖像都會彈出一個對話框,要求您確認打印。 而其他類型的文件將直接打印。
  • 不會打印郵件正文中的圖像。
  • 如果你得到 此項目中的宏已禁用 錯誤,請查看本教程: 如何在 Outlook 中啟用和禁用宏?

 


演示:在Outlook電子郵件中打印一個或所有附件


尖端: 在這個視頻裡, 庫工具 選項卡添加者 Kutools for Outlook。 如果需要,請單擊 点击這裡 免費試用60天!


最佳辦公生產力工具

Kutools for Outlook - 超過 100 種強大的功能可增強您的 Outlook

🤖 人工智慧郵件助手: 具備人工智慧魔力的即時專業電子郵件——一鍵天才回覆、完美語調、多語言掌握。輕鬆改變電子郵件! ……

📧 電子郵件自動化: 外出(適用於 POP 和 IMAP)  /  安排發送電子郵件  /  發送電子郵件時按規則自動抄送/密件副本  /  自動轉送(進階規則)   /  自動添加問候語   /  自動將多收件者電子郵件拆分為單獨的訊息 ...

📨 電子郵件管理: 輕鬆回憶電子郵件  /  按主題和其他人阻止詐騙電子郵件  /  刪除重複的電子郵件  /  進階搜索  /  合併資料夾 ...

📁 附件專業版批量保存  /  批量分離  /  批量壓縮  /  自動保存   /  自動分離  /  自動壓縮 ...

🌟 介面魔法: 😊更多又漂亮又酷的表情符號   /  使用選項卡式視圖提高 Outlook 工作效率  /  最小化 Outlook 而不是關閉 ...

👍 一鍵奇蹟: 使用傳入附件回覆全部  /   反網路釣魚電子郵件  /  🕘顯示寄件者的時區 ...

👩🏼‍🤝‍👩🏻 通訊錄和行事曆: 從選定的電子郵件中大量新增聯絡人  /  將聯絡人群組拆分為各組  /  刪除生日提醒 ...

超過 100特點 等待您的探索! 按此處了解更多。

了解更多       免費下載      購買
 

 

Comments (24)
Rated 5 out of 5 · 1 ratings
This comment was minimized by the moderator on the site
Is it possible to specify a network printer instead of always printing with the standard printer?
This comment was minimized by the moderator on the site
Dear all,

I had tried the VBA and the code runs but many popups are opening on screen to print images from the mail signature (apparently this is considered an attachment). Anyone knows how to solve it?

S.
This comment was minimized by the moderator on the site
If you don't want to print pictures in the body of a message, please use the code below:
Sub PrintAllAttachmentsInMultipleMails()
  'Update by ExtendOffice 2022/08/05
  Dim xShellApp As Object
  Dim xFSO As Scripting.FileSystemObject
  Dim xItem As Object
  Dim xTempFldPath, xFilePath As String
  Dim xSelItems As Outlook.Selection
  Dim xMailItem As Outlook.MailItem
  Dim xAttachments As Outlook.Attachments
  Dim xAttachment As Outlook.Attachment
  Dim xFile As File
  On Error Resume Next
  Set xFSO = New Scripting.FileSystemObject
  xTempFldPath = xFSO.GetSpecialFolder(2).Path & "\Attachments " & Format(Now, "yyyymmddhhmmss") 'xFSO.GetSpecialFolder(2) For saving temporary files
  If xFSO.FolderExists(xTemfldpath) = False Then 'create temporary folder
    xFSO.CreateFolder (xTempFldPath)
  End If
  Set xSelItems = Outlook.ActiveExplorer.Selection
  Set xShellApp = CreateObject("Shell.Application")
  For Each xItem In xSelItems
    If xItem.Class = OlObjectClass.olMail Then
      Set xMailItem = xItem
      Set xAttachments = xMailItem.Attachments
      For Each xAttachment In xAttachments
        If IsEmbeddedAttachment(xAttachment) = False Then
          xFilePath = xTempFldPath & "\" & xAttachment.FileName
          xAttachment.SaveAsFile (xFilePath)
          Debug.Print xFilePath
        End If
      Next
    End If
  Next
  For Each xFile In xFSO.GetFolder(xTempFldPath).Files
    VBA.DoEvents
    Call xShellApp.ShellExecute(xFile.Path, "", "", "print", 0)
  Next
  Set xSelItems = Nothing
  Set xShellApp = Nothing
  Set xFSO = Nothing
End Sub

Function IsEmbeddedAttachment(Attach As Attachment)
Dim xItem As MailItem
Dim xCid As String
Dim xID As String
Dim xHtml As String
On Error Resume Next
IsEmbeddedAttachment = False
Set xItem = Attach.Parent
If xItem.BodyFormat <> olFormatHTML Then Exit Function
xCid = ""
xCid = Attach.PropertyAccessor.GetProperty("http://schemas.microsoft.com/mapi/proptag/0x3712001F")
If xCid <> "" Then
    xHtml = xItem.HTMLBody
    xID = "cid:" & xCid
    If InStr(xHtml, xID) > 0 Then
        IsEmbeddedAttachment = True
    End If
End If
End Function
This comment was minimized by the moderator on the site
Dear Amanda,

Thank you for the code. It worked!

S.
This comment was minimized by the moderator on the site
Hi there,

Sorry that printing images will bring up popups. You will have to confirm each to download all the images. If you don't need to print images, please click Cancel.

Amanda
This comment was minimized by the moderator on the site
I am using Microsoft 365 and this worked after deleting line 9. Thanks! This has saved a bit of time for me.
Rated 5 out of 5
This comment was minimized by the moderator on the site
hallo, ich möchte nur den Anhang der Mails von der angegebenen Adresse senden, wie kann ich das machen, danke
This comment was minimized by the moderator on the site
Vielen, vielen Dank dafür! Hat uns enorm viel Arbeit erspart.Auch ich musste - wie bereits in den Kommentaren geschrieben - die neunte Zeile "Dim xAttachment As Outlook.Attachment On Error Resume Next" entfernen, dann lief der Code einfandfrei durch.
This comment was minimized by the moderator on the site
Hi, this worked fine for me yesterday but now it is saying 'the macros in this project are disabled' Any advice how to enable them? 
This comment was minimized by the moderator on the site
This comment was minimized by the moderator on the site
on line 9 , removing "On Error Resume Next" worked for me.
This comment was minimized by the moderator on the site
Hi everyone, we updated the VBA code in the tutorial on 2022/08/03. If you still need to print all attachments, please check the new code. 😊
This comment was minimized by the moderator on the site
Hi, I have been using this shortcut for a few weeks now, printing all attachments from multiple emails at once, and I have recently been having to remove line 9 as Nilanka said, which has been working, but this no longer works. Im getting the warning box saying the macros in this project are disabled.....and so on... if someone has a solution to make this work as it has been prior to now, please lmk, as i am selecting about 60 emails all containing attachments to print. Thanks
This comment was minimized by the moderator on the site
This comment was minimized by the moderator on the site
Thank you 
This comment was minimized by the moderator on the site
yes this just worked for me as well. Thank you!
This comment was minimized by the moderator on the site
the VBA code gives syntax is error
This comment was minimized by the moderator on the site
if a pdf has the same name the macro prints just one pdf, how can i change the code in order to modify the pdf name?
This comment was minimized by the moderator on the site
if you want to print all attachments together in 1 email here's what you do. first make a folder on your desktop....I named mine "print". go to the email with the attachments....highlight all of the attachments, right click, save all attachments to the print folder. Open the print folder.....highlight all of them.....right click.....print.



now if only I could figure out how to print all the attachments in 200 emails without opening each one and printing it.
This comment was minimized by the moderator on the site
Kutools for Outlook's Detach All (Attachments) feature can help you download all attachments from multiple emails with several clicks! https://www.extendoffice.com/product/kutools-for-outlook/outlook-detach-attachments.html
There are no comments posted here yet
Load More
Please leave your comments in English
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations