I have an Access database that needs to scan through a inbox subfolder to read the "SenderEmailAddress" information. After a lot of good help (and persistence) from BlueDevilFan, we ended up with the following code, which worked a treat. However, it comes up with the Outlook Security message, which I need to get rid of.
Originally we linked into email sub-folders through ADO, which looked ideal - but the ADO object does not present the "SenderEmailAddress".
Unfortunately, we cannot use any third party products for this fix - so any suggestions would be greatly appreciated.
Dim olkApp As Object, olkSes As Object, olkFld As Object, olkMsg As Object
Set olkApp = CreateObject("Outlook.Application")
Set olkSes = olkApp.GetNamespace("MAPI")
Set olkFld = olkSes.GetDefaultFolder(6).Folders("00 Technical").Folders("Bounced emails")
For Each olkMsg In olkFld.Items
Set olkMsg = Nothing
Set olkFld = Nothing
Set olkSes = Nothing
Set olkApp = Nothing