Email address of sender via VBA

User avatar
Abraxus
3StarLounger
Posts: 250
Joined: 01 Mar 2010, 17:34
Location: Blue Springs, MO

Email address of sender via VBA

Post by Abraxus »

I have some code that saves attachments to a folder on my computer, but I also need to capture the sender's email address.

If the sender is outside of the company, this works: Item.SenderEmailAddress

It returns an address as expected: sender@whatevercompany.com

For senders inside our company, however, I get something like this: /O=SPRINTPCS/OU=USKMEX01/CN=RECIPIENTS/CN=JOHN.C.DOE

Any ideas on how to get the sender@whatevercompany.com for ALL items, regardless of if they are in my company or not?

Thanks!
Morgan

User avatar
HansV
Administrator
Posts: 78236
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Email address of sender via VBA

Post by HansV »

I cannot test it at the moment, but does the code in Outlook VBA Script that gets SMTP Address of the Currently Selected Email work for you?
Best wishes,
Hans

User avatar
Abraxus
3StarLounger
Posts: 250
Joined: 01 Mar 2010, 17:34
Location: Blue Springs, MO

Re: Email address of sender via VBA

Post by Abraxus »

Wow, that was fast.

Thanks for pointing me in that direction. So far, it seems to be working as I need it to!
Morgan