Попробуйте приведенный ниже код. Он поможет вам пройти через папку «Входящие» и получить каждое имя файла вложения.
Sub test()
Dim a As Attachments
Dim myitem As Folder
Dim myItemI As Object
Dim j As Long
Dim i As Integer
' Your Inbox folder
Set myitem = Session.GetDefaultFolder(olFolderInbox)
' Loop through all mails in Inbox Folder
For i = 1 To myitem.Items.Count
'Get the mail number i
Set myItemI = myitem.Items(i)
'Get the attachments of the mail number i
Set a = myItemI.Attachments
' if the mail contains attachments
If Not a Is Nothing Then
'Go through and display each attachment filename
For j = 1 To myItemI.Attachments.Count
MsgBox myItemI.Attachments.Item(j).DisplayName
Next j
End If
Next i
End Sub