Skip to main content

How to only print attachment(s) from one email or selected emails in Outlook?

Author: Sun Last Modified: 2020-09-27

In Outlook, you can print the emails, but have you printed the attachments only from one email or selected emails in Outlook? In this article, I introduce the tricks on solving this job.

Only print attachment(s) from one email with Quick Print

Only print attachment(s) from selected emails with VBA


Only print attachment(s) from one email with Quick Print

To print the attachments only without email body, you can use the Quick Print function.

1. In the message window, right click at the attachment you want to print, select Quick Print from the context menu.
doc print attachment 1

2. Then click Save > Save to save the attachment file in a location.
doc print attachment 2
doc print attachment 3

3. Now go to the location you placed the attachment file, and open the file to print as usual.


Only print attachment(s) from selected emails with VBA

If you want to print the attachments from selected emails, you can use VBA code.

1. Select the emails you want to print the attachments, press Alt + F11 keys to enable Microsoft Visual Basic for Applications window.

2. Double click ThisOutlookSession from Project1 pane, copy and paste below code to the script.

VBA:Print attachments from selected emails

Sub BatchPrintAllAttachmentsInMultipleEmails()
'UpdatebyExtendoffice20180417
Dim xFSO As Scripting.FileSystemObject
Dim xTmpFldPath As String
Dim xSelection As Outlook.Selection
Dim xItem As Object
Dim xMailItem As Outlook.MailItem
Dim xAttachments As Outlook.Attachments
Dim xAttachment As Outlook.Attachment
Dim xShell As Object
Dim xTempFolder As Object
Dim xTempFolderItem As Object
Dim xFilePath As String
On Error Resume Next
Set xFSO = CreateObject("Scripting.FileSystemObject")
xTmpFldPath = xFSO.GetSpecialFolder(2).Path & "\Temp for Attachments"
If xFSO.FolderExists(xTmpFldPath) = False Then
    xFSO.CreateFolder xTmpFldPath
End If
Set xSelection = Outlook.Application.ActiveExplorer.Selection
Set xShell = CreateObject("Shell.Application")
Set xTempFolder = xShell.NameSpace(0)
For Each xItem In xSelection
    If xItem.Class = olMail Then
        Set xMailItem = xItem
        If xMailItem.Attachments.Count = 0 Then Exit Sub
        Set xAttachments = xMailItem.Attachments
        For Each xAttachment In xAttachments
            xFilePath = xTmpFldPath & "\" & xAttachment.FileName
            xAttachment.SaveAsFile (xFilePath)
            Set xTempFolderItem = xTempFolder.ParseName(xFilePath)
            xTempFolderItem.InvokeVerbEx ("print")
        Next
    End If
Next

'If xFSO.FolderExists(xTmpFldPath) Then
'    xFSO.DeleteFolder xTmpFldPath, True
'End If
End Sub

doc print attachment 4

3. Then click Tools > References, and in the References dialog, check Microsoft Scripting Runtime checkbox.
doc print attachment 5   doc print attachment 6

4. Click OK, then press F5 key to print all attachments in the selected emails in bulk.

Note: If the attachment is picture, it will pop out a Print Pictures dialog first, click Print to go to the Save Print Output As dialog.
doc print attachment 7


Best Office Productivity Tools

Breaking News: Kutools for Outlook Launches Free Version!

Experience the all-new Kutools for Outlook FREE version with 70+ incredible features, yours to use FOREVER! Click to download now!

🤖 Kutools AI : Instant pro emails with AI magic--one-click to genius replies, perfect tone, multilingual mastery. Transform emailing effortlessly! ...

📧 Email Automation: Auto Reply (Available for POP and IMAP)  /  Schedule Send Emails  /  Auto CC/BCC by Rules When Sending Email  /  Auto Forward (Advanced Rules)   /  Auto Add Greeting   /  Automatically Split Multi-Recipient Emails into Individual Messages ...

📨 Email Management: Recall Emails  /  Block Scam Emails by Subjects and Others  /  Delete Duplicate Emails  /  Advanced Search  /  Consolidate Folders ...

📁 Attachments ProBatch Save  /  Batch Detach  /  Batch Compress  /  Auto Save   /  Auto Detach  /  Auto Compress ...

🌟 Interface Magic: 😊More Pretty and Cool Emojis   /  Remind you when important emails come  /  Minimize Outlook Instead of Closing ...

👍 One-click Wonders: Reply All with Incoming Attachments  /   Anti-Phishing Emails  /  🕘Show Sender's Time Zone ...

👩🏼‍🤝‍👩🏻 Contacts & Calendar: Batch Add Contacts From Selected Emails  /  Split a Contact Group to Individual Groups  /  Remove Birthday Reminders ...

Instantly unlock Kutools for Outlook with a single click—permanently free. Don't wait, download now and boost your efficiency!

kutools for outlook features1 kutools for outlook features2
 

 

 

Comments (4)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
how do you print attachments in multiple emails but with a certain page range
This comment was minimized by the moderator on the site
I tried the multiple emails option of pasting the VBA code, but when I press F5 to run it, I get a syntax error with this line highlighted:
If xItem.Class = olMail Then


Any ideas?
This comment was minimized by the moderator on the site
Have you check the Microsoft Scripting Runtime checkbox?
This comment was minimized by the moderator on the site
how can I enable the macro's? Last week it worked perfectly.
There are no comments posted here yet
Leave your comments
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations