I am trying to use Outlook VBA to go through the inbox and list the email address if the subject matches the line. Got it so far from googling, but it does not work:
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
Does anyone know why I get a type mismatch error on startup?
vba outlook
Superdooperhero
source share