Auto Detach/print

S

stev379

I have a script that will print files in a folder on the hard drive (not an
Outlook folder). I'd like have Outlook XP automatically detach files from a
specific sender to this folder. I've used VBS off and on for about 2 years,
but I'm not familiar with scripts in Outllook at all. I found a few things
in this forum that look like they may help, but I'm not sure how to implement
them.

How would I put this in place and set Outlook XP to run it for a specific
sender?
'--------------------
'Posted by Michael Bednarek
Sub PrintAtt()

Dim myAtt As Outlook.Attachment
Dim strTemp As String
Dim objShell As New Shell
Dim objFolderItem As FolderItem

strTemp = Environ("Temp")
For Each myAtt In ActiveInspector.CurrentItem.Attachments
myAtt.SaveAsFile (strTemp & "\" & myAtt.FileName)
Set objFolderItem = objShell.NameSpace(strTemp).Items.Item(myAtt.FileName)
objFolderItem.InvokeVerb ("Print")
'Kill objFolderItem.Path ' Can't delete yet because "Print" runs
asynchronously
Next myAtt
ActiveInspector.Close (olDiscard)
End Sub
'---------------------------

Thanks for any help or suggestions!
 

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