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
--
Viele Gruesse / Best regards
Michael Bauer - MVP Outlook
> 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.
|