Y
Yonah Sudwerts
Here is my procedure ..
Private Sub myOlItems_ItemAdd(ByVal Item As Object)
Dim objMsg As Object, objAttachments As Outlook.Attachments
For Each objMsg In myOlItems
Set objAttachments = objMsg.Attachments
lngCount = objAttachments.Count
If lngCount > 0 Then
For i = lngCount To 1 Step -1
strFile = "C:\" & objAttachments.Item(i).FileName
objAttachments.Item(i).SaveAsFile strFile
Next i
End If
objMsg.Save
Next
End Sub
I am trying to handle each Email as it arrives, but obviously, if you can
notice the problem is that it runs on the entire Inbox Folder. My
understanding is that the Procedure also receives the ID number [ The (ByVal
Item As Object)part]. That is what I understand. Now, How would I go about
using that ID to access only that email?
Yes, the myOlItems object is initialized, if I stick some simple Msgbox in
here instead of all my code, it works, so I know that the procedure is
responding when a new email arrives.
Can someone please help me out?
Thanks,
Yoni
Private Sub myOlItems_ItemAdd(ByVal Item As Object)
Dim objMsg As Object, objAttachments As Outlook.Attachments
For Each objMsg In myOlItems
Set objAttachments = objMsg.Attachments
lngCount = objAttachments.Count
If lngCount > 0 Then
For i = lngCount To 1 Step -1
strFile = "C:\" & objAttachments.Item(i).FileName
objAttachments.Item(i).SaveAsFile strFile
Next i
End If
objMsg.Save
Next
End Sub
I am trying to handle each Email as it arrives, but obviously, if you can
notice the problem is that it runs on the entire Inbox Folder. My
understanding is that the Procedure also receives the ID number [ The (ByVal
Item As Object)part]. That is what I understand. Now, How would I go about
using that ID to access only that email?
Yes, the myOlItems object is initialized, if I stick some simple Msgbox in
here instead of all my code, it works, so I know that the procedure is
responding when a new email arrives.
Can someone please help me out?
Thanks,
Yoni