Auto Print email and word attachments on send

M

Matt Bennette

Hi guys,

I have a created a standard template and would like it to print the e-mail
contents and the word attachements when I click send.

Any assistance would be greatly appreciated.
 
D

diamondgator

Good Afternoon Michael,
I get a lot of attachments in PDF, DOC, XLS and JPG formats. I have the
software required to print each format. So I have attempted to use this
script but it is not working for me. I entered the script, then made a rule
that filtered it down to specific mailboxes (not my primary mailbox).
I don't believe I have edited it at all but here it is:
Private Sub PrintAttachments(oMail As Outlook.MailItem)

On Error Resume Next
Dim colAtts As Outlook.Attachments
Dim oAtt As Outlook.Attachment
Dim sFile As String
Dim sDirectory As String
Dim sFileType As String

sDirectory = "D:\Attachments\"

Set colAtts = oMail.Attachments

If colAtts.Count Then
For Each oAtt In colAtts

sFileType = LCase$(Right$(oAtt.FileName, 4))

Select Case sFileType
Case ".xls", ".doc"
sFile = ATTACHMENT_DIRECTORY & oAtt.FileName
oAtt.SaveAsFile sFile
ShellExecute 0, "print", sFile, vbNullString, vbNullString, 0
End Select
Next
End If
End Sub

Is there something else I need to do or am I missing something??

Thanks in Advance!!
Rich Webb
 
M

Michael Bauer [MVP - Outlook]

This example handles xls and doc only, and it requires that the directory
already exists. Have you considered that?

--
Best regards
Michael Bauer - MVP Outlook

: Outlook Categories? Category Manager Is Your Tool
: VBOffice Reporter for Data Analysis & Reporting
: <http://www.vboffice.net/product.html?pub=6&lang=en>


Am Fri, 10 Apr 2009 16:28:08 -0700 schrieb (e-mail address removed):
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top