Hello Karen,
you could do that with a VBA script in Outlook.
This sample script checks for new arrived Emails (unread) and see if it had
PDF Files attached.
If so, the attachments are save to a Folder on Harddisk. (C:\Temp)
If you want to start an executable you can do that with a wshshell object.
Hope this get you started.
Start Outlook, Press Alt+F11
Double click Outlook Session
Paste in this code...
-------------------------- Begin of
Code -----------------------------------------
'
' By Helmut Obertanner
' DATALOG Software AG 2005
'
http://www.datalog.de
' Saves PDF File from incomming Attachments to C:\Temp
'
' Install:
'
' Start Outlook
' Press 'Alt + F11'
' Double Click on Outlook Session
' Paste this code below
'
Private Sub Application_NewMail()
CheckForPDFFiles
End Sub
Private Sub CheckForPDFFiles()
Dim objItems As Outlook.Items
Dim objInbox As MAPIFolder
Dim objMail As Outlook.MailItem
Dim objAttachment As Outlook.Attachment
Dim strFileName As String
Dim strTargetPath As String
On Error Resume Next
' Get the Inbox Folder
Set objInbox = Session.GetDefaultFolder(olFolderInbox)
' Get new unread Mails from Inbox folder
Set objItems = objInbox.Items.Restrict("[MessageClass] = 'IPM.Note' AND
[Unread] = true")
For Each objMail In objItems
'Check if we have attachments
For Each objAttachment In objMail.Attachments
'Check if we have a .PDF File
strFileName = LCase(objAttachment.FileName)
If Right(strFileName, 4) = ".pdf" Then
objAttachment.SaveAsFile ("C:\Temp\" &
Format(objMail.ReceivedTime,"yymmddhhMMss") & "-" & strFileName)
End If
Next
Next
End Sub
-------------------------- End of
Code --------------------------------------------
--
with regards
Helmut Obertanner
Technical Consultant
Softwaredevelopment
DATALOG Software AG | Zschokkestr. 36 | D-80687 Munich
web:
www.datalog.de
.... and IT works!