These are the references I used:
Microsoft Office 12.0 Access database engine objects
Microsoft Office 12.0 Object Library
Microsoft Office Outlook 12.0 Object Library
OLE Automation
Microsoft Access 12.0 Object Library
Visual Basic for Applications
this is the code I used:
Code:
Dim nameSpace As nameSpace
Dim InboxFolder As MAPIFolder
Dim outlookItem As Object
Dim mailAttachment As Outlook.Attachment
Dim fName As String
Dim InboxItems As Outlook.Items
Set nameSpace = GetNamespace("MAPI")
Set InboxFolder = nameSpace.GetDefaultFolder(olFolderInbox)
Set InboxItems = InboxFolder.Items
For Each outlookItem In InboxItems
For Each mailAttachment In outlookItem.Attachments
fName = "C:\Test\" & mailAttachment.FileName
mailAttachment.SaveAsFile fName
Next mailAttachment
Next outlookItem
it correctly downloaded all attachments from the inbox into the c:\test\ folder
If you wanted to check a specific email from address or test the subject line etc you could do that as well.