从Outlook获取电子邮件地址

时间:2012-02-07 22:49:22

标签: asp.net vb.net email outlook

我正在尝试通过Outlook插件输出当前用户的电子邮件地址。我还没有能够得到任何其他的例子。我最接近的是:

emailitem.SenderEmailAddress

输出:

Smith, John

但我想:

JohnSmith@hotmail.com

任何想法?

1 个答案:

答案 0 :(得分:0)

Dim addrEntry As Outlook.AddressEntry = Application.Session.CurrentUser.AddressEntry
                    If addrEntry.Type = "EX" Then
                        Dim currentUser As Outlook.ExchangeUser = Application.Session.CurrentUser.AddressEntry.GetExchangeUser()
                        If currentUser IsNot Nothing Then
                            MsgBox("Name: " + currentUser.Name)
End If