View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Michel Pierron Michel Pierron is offline
external usenet poster
 
Posts: 214
Default Real Users Name Not Lan ID

Hi Lime,
You can try:

Sub GetFullName()
Dim Domain$, User$
With CreateObject("Wscript.Network")
Domain = .UserDomain: User = .username
End With
MsgBox GetObject("WinNT://" & Domain & "/" & User & ",user").fullname, 64
End Sub

MP

"Lime" a écrit dans le message de news:
...
Hello,
Question, I would like to have a VB Macro that auto populates a Textbox1
with the real name of the user of the form. This form will be used on a
very
lage network and people sign on with lan ID's. For example My lan is
Rk9954
but my real name is Joe Shmoe. When I use Environ("username") is puts out
the
lan ID as the user. What I need its it to display the Real name of the
user.

any Help?
Lime