Printer Forums

Printer Forums - Printing Help and Support > Newsgroups > Printer Newsgroups > Outlook Printing > Printing TIFF/JPG Attachments

Reply
Thread Tools Display Modes

Printing TIFF/JPG Attachments

 
 
Henk Pols
Guest
Posts: n/a

 
      03-19-2009, 09:18 PM
Does anyone have the vba code to print an Tiff/JPG attachment?

I am writng a code that will print a selected E-mail and all attached
documents. So far Iam able to print .doc and .xls attachments, I am missing
the correct code to print .tif and .jpg attachment.

Below is my code sofar:
Sub MyPrint()
Dim myOlApp As New Outlook.Application
Dim myOlExp As Outlook.Explorer
Dim myOlSel As Outlook.Selection
Dim Atmt As Attachment
Dim FileName As String
Dim PrtProg As String
Dim cmd As String
Dim x As Integer

Set myOlExp = myOlApp.ActiveExplorer
Set myOlSel = myOlExp.Selection
For x = 1 To myOlSel.Count
myOlSel.Item(x).PrintOut
For Each Atmt In myOlSel.Item(x).Attachments
FileName = "C:\Windows\Temp\" & Atmt.FileName
Atmt.SaveAsFile FileName
Select Case Right(FileName, 3)
Case "xls":
Dim xlApp As Excel.Application
Dim wb As Excel.Workbook
Set xlApp = New Excel.Application
Set wb = xlApp.Workbooks.Open(FileName)
wb.PrintOut
xlApp.Quit
Set wb = Nothing
Set xlApp = Nothing
Case "doc":
Dim wdApp As Word.Application
Dim doc As Word.Document
Set wdApp = New Word.Application
Set doc = wdApp.Documents.Open(FileName)
doc.PrintOut
wdApp.Quit False
Set doc = Nothing
Set wdApp = Nothing
Case "tiff":
Case "jpg":
Case "bmp":
Case "pdf": 'Via Arobat32.exe
Case "dwg": 'Via ACad32
Case Else:
End Select
Next Atmt
Next x
End Sub

Thanks in advance for any input on this issue.



 
Reply With Quote
 
 
 
 
Brian Tillman [MVP - Outlook]
Guest
Posts: n/a

 
      03-20-2009, 12:48 PM
"Henk Pols" <> wrote in message
news:49c2c4cd$0$6678$...

> Does anyone have the vba code to print an Tiff/JPG attachment?


microsoft.public.outlook.program_vba is the correct newsgroup for coding
questions. You might want to visit http://www.outlookcode.com/ as well.
--
Brian Tillman [MVP-Outlook]

 
Reply With Quote
Reply

Thread Tools
Display Modes

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
garbled Word attachments when printing MPW Outlook Printing 0 12-11-2007 01:39 PM
Printing Multiple Attachments MarieJ Outlook Printing 0 09-27-2005 06:39 PM
Printing multiple attachments at once Kmullen Outlook Printing 1 08-13-2005 12:37 PM
Printing Attachments Mat Sutton Outlook Printing 1 06-16-2004 10:32 AM
Printing random # of multiple attachments Jon Barron Outlook Printing 0 03-05-2004 05:14 PM



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32