How to get Windows Login "Display Name" instead of "username" in V

G

Guest

I found that using 'environ("Username") ' can only returns the windows login
ID, what can I do if I want to get the window's "Display Name" ?

Thanks
Best Regards
Chris
 
G

Guest

I just got the answer from the following Link.
http://www.dbforums.com/archive/index.php/t-1115746.html

Public Function GetUserDisplayName() As String
'--------------------8<----------------------
Set oADSystemInfo = CreateObject("ADSystemInfo")
' get user object
Set oADsUser = GetObject("LDAP://" & oADSystemInfo.USERNAME)
' get full name of the current user
GetUserDisplayName = oADsUser.DisplayName
'--------------------8<----------------------
End Function
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top