Link to home
Start Free TrialLog in
Avatar of Mark Miles
Mark MilesFlag for United States of America

asked on

Auto Print Email Attachments as they arrive in my inbox, Outlook 2016

I have a group of outsourced workers that work for me from India.  We are wanting them to be able to send PDF documents directly to a printer in our office in the US, but.... do not want to have them connecting to our office via a VPN or anything like that.

With that being said, I am wondering if it is possible to have them email the PDF to an email address that uses Outlook 2016 and setup a script or something that would run every 30 seconds or so looking for all new emails and automatically printing any attachments, then marking the email as read and moving to another folder?

If so, can I get assistance with the code/script or any software that would do this?  In pretty bad need as this was just added to my plate and they want it ready by Monday.
Any assistance is appreciated.  Operating System is Windows 10 Pro, 64 Bit
Avatar of hdhondt
Flag of Australia image

Some printers are able to print emails directly if it is sent to the printer's email address. Check to see if your printer does, or post its model here.

If the printer cannot do it, the following VBA script should do the job. Enter it from the Developer tab. You'll then need to set a rule to run the script.

On Error GoTo OError’detect Temp
Dim oFS As FileSystemObject
Dim sTempFolder As String
Set oFS = New FileSystemObject
‘Temporary Folder Path
sTempFolder = oFS.GetSpecialFolder(TemporaryFolder)’creates a special temp folder
cTmpFld = sTempFolder & “\OETMP” & Format(Now, “yyyymmddhhmmss”)
MkDir (cTmpFld)’save & print
Dim oAtt As Attachment
For Each oAtt In Item.Attachments
FileName = oAtt.FileName
FullFile = cTmpFld & “\” & FileName’save attachment
oAtt.SaveAsFile (FullFile)’prints attachment
Set objShell = CreateObject(“Shell.Application”)
Set objFolder = objShell.NameSpace(0)
Set objFolderItem = objFolder.ParseName(FullFile)
objFolderItem.InvokeVerbEx (“print”)Next oAtt
If Not oFS Is Nothing Then Set oFS = Nothing
If Not objFolder Is Nothing Then Set objFolder = Nothing
If Not objFolderItem Is Nothing Then Set objFolderItem = Nothing
If Not objShell Is Nothing Then Set objShell = Nothing

If Err <> 0 Then
MsgBox Err.Number & ” – ” & Err.Description
End If
Exit Sub

End Sub

Open in new window

For more details see this webpage. However, I have also read somewhere that Outlook no longer supports scripts.
Avatar of Mark Miles


Printer Model is:  HP LaserJet P2035n
As far as I can tell, that printer does not support email printing, even with the network card installed.
Is there a printer model you know of that will print to email like you are saying?  A brother or Dell?
I'll have a look later today. What kind of specs & price range?
Just need to have ability to scan to email (office 365) obviously need to be able to have this email address assigned to it so I have them in India send it directly to that printer in the US and have it print out.

$150-$400 preferably.
Avatar of hdhondt
Flag of Australia image

Link to home
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
what printers are email capable if not in that price range?
Will this one work, with ePrint?

HP LaserJet Pro M203dw Wireless Laser Printer
Yes, it is listed on the ePrint support page I posted.
Thank you hdhondt, wonderful experience.  You were very helpful.
My pleasure.