Print attachments

G

Guest

Hi all

I have recently changed to OUtlook from Groupwise. One thing you could do in
groupwise was print more than one attachment without opening it. So if I had
3 word files attached I could highlight them all and print. Is this possible
in Outlook?

Any help greatly appreciated

Kind regards

Rexmann
 
G

Guest

If you are using Outlook 2003, here is a macro that will let you print all
the attachments contained in an email to your default printer. One
problem-if you have multiple PDF files, they will print randomly unless your
default printer uses a postscript driver.

Private Declare Function ShellExecute Lib "shell32.dll" _
Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, _
ByVal lpFile As String, ByVal lpParameters As String, _
ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long



Sub SaveAttachment()
Dim myItems, myItem, myAttachments, myAttachment As Object
Dim myOrt As String
Dim myOlApp As New Outlook.Application
Dim myOlExp As Outlook.Explorer
Dim myOlSel As Outlook.Selection
Dim strFile As String

'Set destination folder
myOrt = "C:\program files\microsoft office\"


On Error Resume Next
'work on selected items
Set myOlExp = myOlApp.ActiveExplorer
Set myOlSel = myOlExp.Selection
'for all items do...
For Each myItem In myOlSel
'point on attachments
Set myAttachments = myItem.Attachments
If myAttachments.Count > 0 Then
'for all attachments do...
For i = 1 To myAttachments.Count
'save them to destination
myAttachments(i).SaveAsFile myOrt &
myAttachments(i).DisplayName
strFile = myOrt & myAttachments(i).DisplayName
ShellExecute 0&, "print", strFile, 0&, 0&, 0&

Next i
myItem.Save

End If
Next
Set myItems = Nothing
Set myItem = Nothing
Set myAttachments = Nothing
Set myAttachment = Nothing
Set myOlApp = Nothing
Set myOlExp = Nothing
Set myOlSel = Nothing



End Sub
 

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