A lot of us receive emails with PDF attachments (eg: invoices, faxes, etc), where we want to open the email and print the attachment. This can be a time consuming task, and I was looking for a way to automate.
I found this site which was very helpful, however it didn’t quite work for me so I have made some changes and explained further how to configure this below.
Firstly, you need all the emails you want to print to be in a single folder. Create a new folder directly under your Personal Folders – right click on Personal Folders and then click “New Folder” In my example below, I have called this folder ..To Print
Secondly, create a new folder called .Printed this is where the emails are moved to after the attachments are printed.
You can either move emails manually to this folder by dragging and dropping them (if you receive ad-hoc emails from different senders), or you can create an Outlook Rule to move all emails from particular senders into your “To Print” folder.
Now, to print automatically batch print all those PDF’s in that folder, do the following:
Step 1: Create a Visual Basic Macro
Open Outlook, click Tools – Macro – Visual Basic Editor
Click Insert – Module
Highlight the code below, press CTRL-C to copy it then click into your empty Module1 and press CTRL-V to paste it
Close the Visual Basic Editor
Public Sub PrintAttachments() Dim Inbox As MAPIFolder Dim Item As MailItem Dim Atmt As Attachment Dim FileName As String Dim i As Integer Set Inbox = GetNamespace("MAPI").GetDefaultFolder(olFolderInbox).Parent.Folders.Item("..To Print") Set Printed = GetNamespace("MAPI").GetDefaultFolder(olFolderInbox).Parent.Folders.Item(".Printed") For Each Item In Inbox.Items For Each Atmt In Item.Attachments FileName = "C:\Temp\" & Atmt.FileName Atmt.SaveAsFile FileName Shell """C:\Program Files\Adobe\Reader 9.0\Reader\acrord32.exe"" /h /p """ + FileName + """", vbHide Next Item.Move Printed Next Set Inbox = Nothing End Sub
Right click up on the toolbar (where all your icons are)
Left Click on Customize
Click the Commands tab
Click on Macros on the left hand side
Click and drag “Project1.PrintAttachments” up to your toolbar. A little black vertical bar will display as you drag it, and when it is positioned where you want the icon to be, let go of the mouse button. You will now have a new button called “Project1.PrintAttachments”
Right click on that new button and click Default Style - this will take away the text and you will have a strange triangle icon.
Right click on that new icon and click Change Button Image, and choose an icon you like.
You now have an icon in your taskbar. Click it and all the PDF attachments are automtically printed and then moved to your printed folder.