nicolas_image
asked on
Get sender email address Outlook.MailItem
How do I find the sender email?
I can get the sender name with the .SenderName property. But how do I get the email address?
I am using the outlook.mailitem
I can get the sender name with the .SenderName property. But how do I get the email address?
I am using the outlook.mailitem
ASKER
I have tried the following code:
- - - - - CUT - - - -
Set MailItem = oSelection.Item(Counter)
With MailItem
If Not (.Recipients Is Nothing) Then
Set RecipList = .Recipients
For Each Recip In RecipList
Select Case Recip.Type
Case olTo
msgbox "TO: " & Recip.adress
Case olCC
msgbox "CC: " & Recip.adress
Case olBCC
msgbox "BCC: " & Recip.adress
Case olOriginator
msgbox "From: " & Recip.adress
- - - - - CUT - - - - - -
But my code never display the MSGBOX "From:" WHY!!!
- - - - - CUT - - - -
Set MailItem = oSelection.Item(Counter)
With MailItem
If Not (.Recipients Is Nothing) Then
Set RecipList = .Recipients
For Each Recip In RecipList
Select Case Recip.Type
Case olTo
msgbox "TO: " & Recip.adress
Case olCC
msgbox "CC: " & Recip.adress
Case olBCC
msgbox "BCC: " & Recip.adress
Case olOriginator
msgbox "From: " & Recip.adress
- - - - - CUT - - - - - -
But my code never display the MSGBOX "From:" WHY!!!
ASKER
I have tried the following code:
- - - - - CUT - - - -
Set MailItem = oSelection.Item(Counter)
With MailItem
If Not (.Recipients Is Nothing) Then
Set RecipList = .Recipients
For Each Recip In RecipList
Select Case Recip.Type
Case olTo
msgbox "TO: " & Recip.adress
Case olCC
msgbox "CC: " & Recip.adress
Case olBCC
msgbox "BCC: " & Recip.adress
Case olOriginator
msgbox "From: " & Recip.adress
- - - - - CUT - - - - - -
But my code never display the MSGBOX "From:" WHY!!!
- - - - - CUT - - - -
Set MailItem = oSelection.Item(Counter)
With MailItem
If Not (.Recipients Is Nothing) Then
Set RecipList = .Recipients
For Each Recip In RecipList
Select Case Recip.Type
Case olTo
msgbox "TO: " & Recip.adress
Case olCC
msgbox "CC: " & Recip.adress
Case olBCC
msgbox "BCC: " & Recip.adress
Case olOriginator
msgbox "From: " & Recip.adress
- - - - - CUT - - - - - -
But my code never display the MSGBOX "From:" WHY!!!
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
OK thanks. Now I found it to. Looks like MS has a small improvement to make here.
Hope this helps