Skip to main content

如何在Outlook中打印一封或多封郵件中的所有附件?

Author: Kelly Last Modified: 2025-05-12

眾所周知,當您在 Microsoft Outlook 中點擊文件 > 列印時,它只會列印郵件內容(例如郵件頭和正文),而不會列印附件。在此我們將向您展示如何輕鬆地在 Microsoft Outlook 中列印選定郵件中的所有附件。


逐個列印一封郵件中的所有附件

Microsoft Outlook 提供了快速列印功能,可以幫助您逐個列印郵件中的附件。

1. 選擇要稍後列印其附件的郵件。

2. 點擊該郵件中的一個附件。

steps of printing all attachments in one email message one by one

3. 在「附件」標籤的「回覆」組中,點擊「快速列印」按鈕。

steps of printing all attachments in one email message one by one
注意: 附件工具 只有當你點擊郵件中的附件時才會被啟用。

4. 出現一個「打開郵件附件」對話框,請點擊「打開 」按鈕。

steps of printing all attachments in one email message one by one

請注意,此步驟將打開所選附件,並同時列印該附件。

要列印此郵件中的其他附件,請重複第 2 至第 4 步。

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

通常,我們可以通過啟用「附件工具」 並應用Outlook中的 「保存所有附件」功能來保存單封郵件中的附件。但是,如果要從多封郵件或整個郵件文件夾中保存附件呢?試試Kutools for Outlook的「保存所有(附件)」功能。

save attachments in multiple emails kto9

批量列印一封郵件中的所有附件

如果一封郵件中有許多附件,逐個列印將非常耗時。以下方法將指導您輕鬆批量列印選定郵件中的所有附件。

1. 選擇要稍後列印其附件的郵件。

2. 在Outlook 2010或更高版本中,請點擊「文件」>「列印」>「列印選項」。見下圖:

steps of batch printing all attachments in one email message

3. 在「列印」對話框中,請勾選「列印附加文件。附件僅列印到預設印表機」選項,在「列印選項」部分。

steps of batch printing all attachments in one email message

4. 點擊「列印」按鈕。

5. 在彈出的「打開郵件附件」對話框中,請點擊「打開 」按鈕以繼續。(注意:此對話框將為每個附件分別彈出。)

steps of batch printing all attachments in one email message

現在,這封選定郵件中的所有附件將一次性列印出來。


批量列印多封選定郵件中的所有附件和圖片

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

1. 在郵件列表中,請按住CtrlShift鍵選擇多封要列印其附件的郵件。

2. 同時按下 Alt + F11 鍵,打開Microsoft Visual Basic for Applications窗口。

3. 在Microsoft Visual Basic for Applications窗口中,點擊「工具」>「引用」。然後如下面所示勾選「Microsoft Scripting Runtime」選項。完成後,點擊「確定」。

steps of batch printing all attachments and pictures in multiple selected emails

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. 在郵件列表中,請按住CtrlShift鍵選擇多封要列印其附件的郵件。

2. 同時按下 Alt + F11 鍵,打開Microsoft Visual Basic for Applications窗口。

3. 在Microsoft Visual Basic for Applications窗口中,點擊「工具」>「引用」。然後如下面所示勾選「Microsoft Scripting Runtime」選項。完成後,點擊「確定」。

the steps of batch printing all attachments in multiple selected emails except pictures in the body

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郵件中的一個或所有附件