Results 1 to 3 of 3
  1. #1
    Enterprise IT Consultant chiefnz's Avatar
    Join Date
    Dec 2004
    Location
    Auckland
    Posts
    1,352

    Default use email rule to print email attachment only

    Hi guys,

    I have a requirement to print a work order attached to an email which comes into a users mailbox. What I have done is;

    1) created a folder specifically for the work order emails.
    2) created an email rule which moves the relevant emails to the folder created in (1) above.
    3) I have a macro which prints the attachments of the emails in the folder I created in (1) above.

    What I need now is to automatically run the macro I have created? At the moment I have to manually run the macro.

    Any ideas would be greatly appreciated. here is the code for my macro.

    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(olFolderInbo x).Parent.Folders.Item("Print Attach")

    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\Acrobat 9.0\Acrobat\Acrobat.exe"" /h /p """ + FileName + """", vbHide
    Next

    Next

    Set Inbox = Nothing
    End Sub

    Asus P8Z77-VL X
    Intel Core i7-3770 @ 3.4GHz
    24GB DDR3 RAM
    1 x 250GB Samsung 840 Series SSD
    1 x Seagate 500GB
    2 x Western Digital 1TB
    Asus DVD/RW
    nVidia GeForce GTX 650 (Asus)
    Thermaltake V3 Black Edition with 550W PSU
    Windows 8.1 Pro

  2. #2

    Default Re: use email rule to print email attachment only

    If you are using outlook its quite easy to do it this way (just use their rules wizard for the rules):
    You will need a running PC with outlook running as the target recipient (A slave PC I suppose you could call it).
    In outlook on that PC go to File/Print
    In the box that comes up check the box that says "Print attached files" - save that.
    Set up a rule to print any new mail and maybe move to another folder/delete whatever

    Now if you mail that user name it should just print - you will get the email printing though as well as the attachments.
    To stop spam you could perhaps always check for some sort of text in the mail or subject heading...

  3. #3
    Enterprise IT Consultant chiefnz's Avatar
    Join Date
    Dec 2004
    Location
    Auckland
    Posts
    1,352

    Default Re: use email rule to print email attachment only

    Thanks Rob, but I tried this initially. I do not want to print the email ONLY the attachments.

    Cheers,

    Asus P8Z77-VL X
    Intel Core i7-3770 @ 3.4GHz
    24GB DDR3 RAM
    1 x 250GB Samsung 840 Series SSD
    1 x Seagate 500GB
    2 x Western Digital 1TB
    Asus DVD/RW
    nVidia GeForce GTX 650 (Asus)
    Thermaltake V3 Black Edition with 550W PSU
    Windows 8.1 Pro

Similar Threads

  1. Email Attachment problem
    By Driftwood in forum PressF1
    Replies: 13
    Last Post: 16-12-2008, 12:07 PM
  2. How to open email attachment
    By peterver in forum PressF1
    Replies: 2
    Last Post: 22-12-2004, 03:31 PM
  3. JPG email attachment
    By aandhwhite in forum PressF1
    Replies: 6
    Last Post: 28-07-2004, 05:57 PM
  4. Email attachment blocking
    By Sami in forum PressF1
    Replies: 12
    Last Post: 16-07-2003, 10:10 AM
  5. Email attachment Virus
    By in forum PressF1
    Replies: 4
    Last Post: 29-08-2001, 10:42 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •