PC Review


Reply
Thread Tools Rate Thread

Auto Print email and word attachments on send

 
 
Matt Bennette
Guest
Posts: n/a
 
      11th Feb 2009
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.
 
Reply With Quote
 
 
 
 
Michael Bauer [MVP - Outlook]
Guest
Posts: n/a
 
      11th Feb 2009


You can modify this sample:
http://www.vboffice.net/sample.html?...owitem&lang=en

Instead of calling it from ItemAdd call it from the ItemSend event.

--
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 Tue, 10 Feb 2009 16:08:01 -0800 schrieb 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.

 
Reply With Quote
 
diamondgator@hotmail.com
Guest
Posts: n/a
 
      11th Apr 2009
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



"Michael Bauer [MVP - Outlook]" wrote:

>
>
> You can modify this sample:
> http://www.vboffice.net/sample.html?...owitem&lang=en
>
> Instead of calling it from ItemAdd call it from the ItemSend event.
>
> --
> 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 Tue, 10 Feb 2009 16:08:01 -0800 schrieb 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.

>

 
Reply With Quote
 
Michael Bauer [MVP - Outlook]
Guest
Posts: n/a
 
      14th Apr 2009


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 Removed):

> 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
>
>
>
> "Michael Bauer [MVP - Outlook]" wrote:
>
>>
>>
>> You can modify this sample:
>>

http://www.vboffice.net/sample.html?...owitem&lang=en
>>
>> Instead of calling it from ItemAdd call it from the ItemSend event.
>>
>> --
>> 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 Tue, 10 Feb 2009 16:08:01 -0800 schrieb 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.

>>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to set outlook to auto print the email and the attachments =?Utf-8?B?bXl6dGlxdWVz?= Microsoft Outlook VBA Programming 1 27th Sep 2007 02:01 PM
Auto print an email and attachments =?Utf-8?B?bXl6dGlxdWVz?= Microsoft Outlook Discussion 1 27th Sep 2007 09:50 AM
Auto send spreadsheets as email attachments =?Utf-8?B?SkRheXdhbHQ=?= Microsoft Excel Programming 1 7th Aug 2007 05:54 PM
How can I send longer (4 page Word) attachments to an email? =?Utf-8?B?QXJ0?= Microsoft Outlook Discussion 2 18th Aug 2006 01:14 AM
How do I send Word attachments in email mesages that auto open =?Utf-8?B?S2lyaw==?= Microsoft Outlook Discussion 1 9th Jun 2004 05:23 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 12:01 AM.