View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
jayklmno jayklmno is offline
external usenet poster
 
Posts: 58
Default Grab Open Outlook Username from Excel

Figured it out for myself...

Sub DisplayCurrentUser()
Dim myolApp As Outlook.Application
Dim myNamespace As Outlook.Namespace
Set myolApp = CreateObject("Outlook.Application")
Set myNamespace = myolApp.GetNamespace("MAPI")
MsgBox myNamespace.CurrentUser
End Sub

Only trouble is it prompts the Outlook Security pop box.

"jayklmno" wrote:

I want to grab the users Outlook Email address while an Excel Macro is
running (and assuming Outlook is also running on the machine). Is there a
quick and dirty way of doing this? If so, please point me in the right
direction.

Thanks!