I am trying to figure out some way to determine the current user's real name while, say, Excel is executing. Application.UserName provides a clue but it is most likely some abbreviation of the user's real name, e.g., jdoe instead of John Doe. The only place that the user's real name might be found is his user name in Outlook. Fetching the user name from another application is pretty easy, for example:
[vba]Sub Test_GetEmail_UserName()
Dim olAppl As Outlook.Application
Dim olNameSpace As Outlook.Namespace
Set olAppl = CreateObject("Outlook.Application")
Set olNameSpace = olAppl.GetNamespace("MAPI")
MsgBox olNameSpace.CurrentUser
olAppl.Quit
Set olNameSpace = Nothing
Set olAppl = Nothing
End Sub[/vba]This approach has two drawbacks:Neither is a big deal, but I would like something that is more invisible. I can get around the 2nd problem with redemption, but that requires (I assume) that redemption be loaded on any user's machine.
- it requires the user to identify the particular profile (if he/she has multiple profiles and has told ol to prompt for a profile)
- given the security now in ol, the user is also told that sensitive information has been requested and is that ok
Any ideas?
Thanks