P
Patrick
This Procedures sends outlook attachments to a directory
based on the subject line from incoming e-mails. However,
is it possible to have those e-mails with subject: AW and
anything thereafter be sent to that directory. Sometimes
the subject changes to: AW (random#).
So I am looking for using something of the LIKE clause in
access, ie LIKE AW*.
Thanks for your help.
Dim WithEvents objInbox As Outlook.Items
Private Sub Application_Startup()
Set objInbox = Session.GetDefaultFolder
(olFolderInbox).Items
End Sub
Private Sub objInbox_ItemAdd(ByVal Item As Object)
If Item.Class = olMail And Item.Subject = "Test Att"
Then
If Item.Attachments.Count > 0 Then
Dim objAttachments As Outlook.Attachments
Set objAttachments = Item.Attachments
For Each objAttach In objAttachments
' Does not handle duplicate filename scenarios
objAttach.SaveAsFile "C:\Test\" &
objAttach.FileName
Next
Set objAttachments = Nothing
End If
End If
End Sub
based on the subject line from incoming e-mails. However,
is it possible to have those e-mails with subject: AW and
anything thereafter be sent to that directory. Sometimes
the subject changes to: AW (random#).
So I am looking for using something of the LIKE clause in
access, ie LIKE AW*.
Thanks for your help.
Dim WithEvents objInbox As Outlook.Items
Private Sub Application_Startup()
Set objInbox = Session.GetDefaultFolder
(olFolderInbox).Items
End Sub
Private Sub objInbox_ItemAdd(ByVal Item As Object)
If Item.Class = olMail And Item.Subject = "Test Att"
Then
If Item.Attachments.Count > 0 Then
Dim objAttachments As Outlook.Attachments
Set objAttachments = Item.Attachments
For Each objAttach In objAttachments
' Does not handle duplicate filename scenarios
objAttach.SaveAsFile "C:\Test\" &
objAttach.FileName
Next
Set objAttachments = Nothing
End If
End If
End Sub