I'm trying to use Outlook VBA to loop through the inbox and list the from email address if the subject matches a string. Got this so far from googling, but it's not working:
Dim objNS As Outlook.NameSpace
Set objNS = GetNamespace("MAPI")
Set Items = objNS.GetDefaultFolder(olFolderInbox).Items
Dim oFolder As Outlook.MAPIFolder
Dim oMail As Outlook.MailItem
For Each oMail In Items
Debug.Print oMail.SenderEmailAddress
Next
Anybody know why I get a Type Mismatch error when I run this?