A Microsoft Outlook email forum. Outlook Banter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Outlook and VBA
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Extract sender of emails email address



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old March 7th 07, 04:35 AM posted to microsoft.public.outlook.program_vba
bony_tony
external usenet poster
 
Posts: 5
Default Extract sender of emails email address

Hi, I've got the code below which extracts the subject and senders
name of emails in a specific folder, however, when I ask for
SenderEmailAddress, it is returning something like, /O=HAYS/OU=HAYS
ADMINISTRATIVE GROUP/CN=RECIPIENTS/CN=NXPEA which i'm guessing is the
internal reference for the person. How do I amend the code so that I
get their actual email address? ie ....?


Sub GetFromInbox()

Dim olApp As Outlook.Application
Dim olNs As NameSpace
Dim Fldr As MAPIFolder
Dim olMail As Variant
Dim i As Integer

Set olApp = New Outlook.Application
Set olNs = olApp.GetNamespace("MAPI")
Set Fldr = olNs.Folders("Public Folders").Folders("All Public
Folders").Folders("SYD").Folders("CredCheck-CP")
i = 1

For Each olMail In Fldr.Items
ActiveSheet.Cells(i, 1).Value = olMail.Subject
ActiveSheet.Cells(i, 2).Value = olMail.SenderName
ActiveSheet.Cells(i, 3).Value = olMail.SenderEmailAddress
i = i + 1
Next olMail

Set Fldr = Nothing
Set olNs = Nothing
Set olApp = Nothing

End Sub

  #2  
Old March 7th 07, 07:09 AM posted to microsoft.public.outlook.program_vba
Michael Bauer [MVP - Outlook]
external usenet poster
 
Posts: 1,885
Default Extract sender of emails email address



In that case you can't read the SMTP address via Outlook object model.
Instead, you'd need to use either CDO 1.21 or Redemption
(http://www.dimastr.com). Then read PR_EMAIL (&H39FE001E) property to obtain
the SMTP address from an AddressEntry object. See
http://www.outlookcode.com/d/code/ge...htm#redemption for an
example.

--
Viele Gruesse / Best regards
Michael Bauer - MVP Outlook
The most effective way to assign Outlook categories:
http://www.shareit.com/product.html?...4&languageid=1
(German: http://www.VBOffice.net/product.html?pub=6)

Am 6 Mar 2007 19:35:34 -0800 schrieb bony_tony:

Hi, I've got the code below which extracts the subject and senders
name of emails in a specific folder, however, when I ask for
SenderEmailAddress, it is returning something like, /O=HAYS/OU=HAYS
ADMINISTRATIVE GROUP/CN=RECIPIENTS/CN=NXPEA which i'm guessing is the
internal reference for the person. How do I amend the code so that I
get their actual email address? ie ....?


Sub GetFromInbox()

Dim olApp As Outlook.Application
Dim olNs As NameSpace
Dim Fldr As MAPIFolder
Dim olMail As Variant
Dim i As Integer

Set olApp = New Outlook.Application
Set olNs = olApp.GetNamespace("MAPI")
Set Fldr = olNs.Folders("Public Folders").Folders("All Public
Folders").Folders("SYD").Folders("CredCheck-CP")
i = 1

For Each olMail In Fldr.Items
ActiveSheet.Cells(i, 1).Value = olMail.Subject
ActiveSheet.Cells(i, 2).Value = olMail.SenderName
ActiveSheet.Cells(i, 3).Value = olMail.SenderEmailAddress
i = i + 1
Next olMail

Set Fldr = Nothing
Set olNs = Nothing
Set olApp = Nothing

End Sub

  #3  
Old March 7th 07, 07:17 AM posted to microsoft.public.outlook.program_vba
bony_tony
external usenet poster
 
Posts: 5
Default Extract sender of emails email address

I can't install anything like that on my work computer.
The only reason I want the email address is so that I can identify if
the person is from NZ or Australia. This information is also stored
under the senders details when I double click their name, they are
located in the global address book. Is there any way I can pull out
their Country/Region from there?

Thanks
Tony

On Mar 7, 5:09 pm, "Michael Bauer [MVP - Outlook]"
wrote:
In that case you can't read the SMTP address via Outlook object model.
Instead, you'd need to use either CDO 1.21 or Redemption
(http://www.dimastr.com). Then read PR_EMAIL (&H39FE001E) property to obtain
the SMTP address from an AddressEntry object. Seehttp://www.outlookcode.com/d/code/getsenderaddy.htm#redemptionfor an
example.

--
Viele Gruesse / Best regards
Michael Bauer - MVP Outlook
The most effective way to assign Outlook categories:
http://www.shareit.com/product.html?...4&languageid=1
(German:http://www.VBOffice.net/product.html?pub=6)

Am 6 Mar 2007 19:35:34 -0800 schrieb bony_tony:



Hi, I've got the code below which extracts the subject and senders
name of emails in a specific folder, however, when I ask for
SenderEmailAddress, it is returning something like, /O=HAYS/OU=HAYS
ADMINISTRATIVE GROUP/CN=RECIPIENTS/CN=NXPEA which i'm guessing is the
internal reference for the person. How do I amend the code so that I
get their actual email address? ie ....?


Sub GetFromInbox()


Dim olApp As Outlook.Application
Dim olNs As NameSpace
Dim Fldr As MAPIFolder
Dim olMail As Variant
Dim i As Integer


Set olApp = New Outlook.Application
Set olNs = olApp.GetNamespace("MAPI")
Set Fldr = olNs.Folders("Public Folders").Folders("All Public
Folders").Folders("SYD").Folders("CredCheck-CP")
i = 1


For Each olMail In Fldr.Items
ActiveSheet.Cells(i, 1).Value = olMail.Subject
ActiveSheet.Cells(i, 2).Value = olMail.SenderName
ActiveSheet.Cells(i, 3).Value = olMail.SenderEmailAddress
i = i + 1
Next olMail


Set Fldr = Nothing
Set olNs = Nothing
Set olApp = Nothing


End Sub- Hide quoted text -


- Show quoted text -



  #4  
Old March 8th 07, 06:53 AM posted to microsoft.public.outlook.program_vba
Michael Bauer [MVP - Outlook]
external usenet poster
 
Posts: 1,885
Default Extract sender of emails email address


No, not with the Outlook object model.

--
Viele Gruesse / Best regards
Michael Bauer - MVP Outlook
The most effective way to assign Outlook categories:
http://www.shareit.com/product.html?...4&languageid=1
(German: http://www.VBOffice.net/product.html?pub=6)


Am 6 Mar 2007 22:17:43 -0800 schrieb bony_tony:

I can't install anything like that on my work computer.
The only reason I want the email address is so that I can identify if
the person is from NZ or Australia. This information is also stored
under the senders details when I double click their name, they are
located in the global address book. Is there any way I can pull out
their Country/Region from there?

Thanks
Tony

On Mar 7, 5:09 pm, "Michael Bauer [MVP - Outlook]"
wrote:
In that case you can't read the SMTP address via Outlook object model.
Instead, you'd need to use either CDO 1.21 or Redemption
(http://www.dimastr.com). Then read PR_EMAIL (&H39FE001E) property to

obtain
the SMTP address from an AddressEntry object.

Seehttp://www.outlookcode.com/d/code/getsenderaddy.htm#redemptionfor an
example.

--
Viele Gruesse / Best regards
Michael Bauer - MVP Outlook
The most effective way to assign Outlook categories:
http://www.shareit.com/product.html?...4&languageid=1
(German:http://www.VBOffice.net/product.html?pub=6)

Am 6 Mar 2007 19:35:34 -0800 schrieb bony_tony:



Hi, I've got the code below which extracts the subject and senders
name of emails in a specific folder, however, when I ask for
SenderEmailAddress, it is returning something like, /O=HAYS/OU=HAYS
ADMINISTRATIVE GROUP/CN=RECIPIENTS/CN=NXPEA which i'm guessing is the
internal reference for the person. How do I amend the code so that I
get their actual email address? ie ....?


Sub GetFromInbox()


Dim olApp As Outlook.Application
Dim olNs As NameSpace
Dim Fldr As MAPIFolder
Dim olMail As Variant
Dim i As Integer


Set olApp = New Outlook.Application
Set olNs = olApp.GetNamespace("MAPI")
Set Fldr = olNs.Folders("Public Folders").Folders("All Public
Folders").Folders("SYD").Folders("CredCheck-CP")
i = 1


For Each olMail In Fldr.Items
ActiveSheet.Cells(i, 1).Value = olMail.Subject
ActiveSheet.Cells(i, 2).Value = olMail.SenderName
ActiveSheet.Cells(i, 3).Value = olMail.SenderEmailAddress
i = i + 1
Next olMail


Set Fldr = Nothing
Set olNs = Nothing
Set olApp = Nothing


End Sub- Hide quoted text -


- Show quoted text -

 




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
multiple sender email address for account fileman Outlook - General Queries 5 October 10th 07 06:55 PM
Macro to extract subject and sender name of messages in folder to Excel file bony_tony Outlook and VBA 0 March 7th 07 02:16 AM
Add all sender from my emails to an address book in outlook [email protected] Outlook - Using Contacts 3 December 21st 06 02:33 PM
script to extract sender ip addresses JTL Outlook and VBA 1 April 25th 06 06:34 AM
can i group emails by sender & by number of items for each sender baffled_by_tech Outlook - Using Contacts 2 March 5th 06 09:27 PM


All times are GMT +1. The time now is 08:55 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2025 Outlook Banter.
The comments are property of their posters.