Get Started
Apr 29, 2019

Setup Outlook to print attachments of incoming emails automatically

photocopier or network printer is office worker tool equipment for scanning and copy paper.You can have Outlook print attachments of incoming emails from certain people automatically. To do that you need to add a script in Outlook.

    Steps to Print Outlook Email Attachments Automatically

  1. In Outlook, go to Developer tab and click "Visual Basic" button
    If you don't have "Developer" tab, go to customize your ribbon/toolbar and add "Developer"
  2. In new window titled "Microsoft Visual Basic for Applications", double-click "ThisOutlookSession" icon in the tree on left side and paste the following script text into the new window on the right:Sub LSPrint(Item As Outlook.MailItem)
    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'Cleanup
    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 = NothingOError:
    If Err <> 0 Then
    MsgBox Err.Number & " - " & Err.Description
    Err.Clear
    End If
    Exit SubEnd Sub
  3. Go to menu Tools > References and add a reference to "Microsoft Scripting Runtime". Click OK button to close References window.
  4. Hit Save icon on top toolbar and close Visual Basic window.
  5. Create a rule in Outlook for all incoming messages from a certain person (or from who you receive those attachments) and choose run a script action.

We hope you have successfully set up Outlook to print attachments.

Contact us if you need further help with Microsoft Office 365

Technology Insights

How IT Strategy Saved a Business from a Cyberattack

How IT Strategy Saved a Business from a Cyberattack

Cyberattacks are often talked about in abstract terms—statistics, headlines, and worst-case scenarios that feel far...
Read More
Why Zombie Agents Will Change Security Forever

Why Zombie Agents Will Change Security Forever

For years, security teams have focused on familiar breach causes: phishing emails, stolen credentials, misconfigured...
Read More
Safepoint IT Default Image

Microsoft 365: Pricing Changes in 2026

If you’ve been in IT long enough, you’ve seen this pattern before. A big announcement...
Read More
chevron-down linkedin facebook pinterest youtube rss twitter instagram facebook-blank rss-blank linkedin-blank pinterest youtube twitter instagram