Avatar of Mark Miles
Mark Miles
Flag 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
Printers and ScannersMicrosoft OfficeVB ScriptVPNEmail Software

Avatar of undefined
Last Comment

8/22/2022 - Mon

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.
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.
All of life is about relationships, and EE has made a viirtual community a real community. It lifts everyone's boat
William Peck
Mark Miles

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?
Mark Miles

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.
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.

View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
Mark Miles

what printers are email capable if not in that price range?
Mark Miles

Will this one work, with ePrint?

HP LaserJet Pro M203dw Wireless Laser Printer

Yes, it is listed on the ePrint support page I posted.
Experts Exchange is like having an extremely knowledgeable team sitting and waiting for your call. Couldn't do my job half as well as I do without it!
James Murphy
Mark Miles

Thank you hdhondt, wonderful experience.  You were very helpful.

My pleasure.