Previous Thread:   How do I delete appointments in Outlook from another computer?

9/30/2005 10:29:01 AM    Detach attachments
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.



10/4/2005 1:45:07 PM    Re: Detach attachments
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  
  
to  
  
handle a