Articles → VBA FOR OUTLOOK → Get The Sender Email Address In VBA
Get The Sender Email Address In VBA
Code
Dim SenderEmail As String
Set objOutlook = CreateObject("Outlook.Application")
Set outMailItem = objOutlook.CreateItem(olMailItem)
If oOutlook.SenderEmailType = "EX" Then
If oOutlook.Sender <> "" Then
SenderEmail = oOutlook.Sender.GetExchangeUser.PrimarySmtpAddress
ElseIf outMailItem.SenderEmailType = "SMTP" Then
SenderEmail = oOutlook.SenderEmailAddress
End If
End If
MsgBox SenderEmail