Hi all.

Hoping someone can help me out here. I have a rule set up so specific mails get auto sent to a folder named Print. What I am trying to do now is to set a vba script that will monitor the folder "Print" and in turn print all emails that are sent to this folder. Preferably, I'd like the script to print out only the attachments or any jpg, png, tif or gif files that are in the email to avoid wasting paper.

So far I have found this script which errors on me when I try and load it. Subsequently, when I receive anything that matches my rule, it gets sent to the Print folder but nothing happens:
''From here starts the function to print anything added to the specified folder.
Public WithEvents objSpecificFolder As Outlook.Folder
Public WithEvents objItems As Outlook.Items


Private Sub Application_Startup()
    'Specify the folder
    'You can change it as per your needs
    Set objSpecificFolder = Application.Session.GetDefaultFolder(olFolderInbox).Folders("Print")
    Set objItems = objSpecificFolder.Items
End Sub


'Macro works when new item lands into the specific folder
Private Sub objItems_ItemAdd(ByVal Item As Object)
    Dim objMail As Outlook.MailItem


    If TypeOf Item Is MailItem Then
       Set objMail = Item
       'Print this mail
       objMail.PrintOut
    End If
End Sub

'Above this line ends the printing of files added to specified folder
Could anyone help me out?