ok, so now i have some questions. i am able to pull the sender, to, subject and names of attachments. the problem is that the procedure is running on the selected item and not the new incoming email. how can i fix that?
turns out the GetAttachmentList procedure is picking up the current selection, how can i make that run for incoming emails?
Public Sub GetAttachmentList()
Dim selItem As Object
Dim aMail As MailItem
Dim aAttach As attachment
Dim Report As String
For Each selItem In Application.ActiveExplorer.Selection
If selItem.Class = olMail Then
Set aMail = selItem
For Each aAttach In aMail.Attachments
'Report = Report & vbCrLf & "------------------------------------------------------------------------" & vbCrLf
Report = Report & GetAttachmentInfo(aAttach)
Next
Call CreateReportEmail("Attachment Report", Report)
End If
Next
End Sub