Detach attachments

G

Guest

Mom's old Mac won't connect to the printer so she forwards her attachments to
me, but she has to wait for me to come home to print since she can't handle a
PC (I know, I know...).

How can I program Outlook XP to automatically print attachments from a
specific sender? I found apps on the net that will do it, but I'd rather
learn how to program Outlook.

Thanks for any help or suggestions!!
I've got some VBS experience, but have never programmed in Outlook.
 
M

Michael Bauer

Am Fri, 30 Sep 2005 10:29:01 -0700 schrieb stev379:

You could use a rule to move your Mom´s mails into a specific folder. Then
use the folder´s ItemAdd event to check for attachments. They need to be
saved on to the file system with the Attachment.SaveAsFile method.

Both, ItemAdd and SaveAsFile, are explained in the VBA help.

After saving the attachment you can print every file with the following
sample, assuming there´s a proper application for the file on your computer.

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

Public Function PrintFile(sFile As String) As Boolean
PrintFile = CBool(ShellExecute(0, "print", sFile, vbNullString,
vbNullString, 0))
End Function
 

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