Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

retreiving SenderName

0 views
Skip to first unread message

Todd

unread,
Jan 28, 2002, 1:06:41 PM1/28/02
to
Why is it, when I view a message using VBA, the .SenderName value of
the message displays the Proper Name (IE: "Bob Smith") instead of the
E-mail Address (IE: bob....@anywhere.com).

TIA

Todd

unread,
Jan 30, 2002, 4:44:07 AM1/30/02
to
Figured it out...here's how!

Public Function Get_Email_Address(MsgID As String) As String

Dim oApp As New Outlook.Application
Dim oNS As Outlook.NameSpace
Dim oMailFolder As Object
Dim oMailItem As Outlook.MailItem

Set oApp = CreateObject("Outlook.Application")
Set oNS = oApp.GetNamespace("MAPI")
Set oMailFolder = oNS.GetDefaultFolder(olFolderInbox).Items

For Each oMailItem In oMailFolder
If oMailItem.EntryID = MsgID Then
Get_Email_Address = oMailItem.Reply.Recipients(1).Address
Exit For
End If
Next

Set oMailFolder = Nothing
Set oNS = Nothing
Set oApp = Nothing

Exit Function
..................................................
todma...@hotmail.com (Todd) wrote in message news:<848543ae.02012...@posting.google.com>...

0 new messages