ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Real Users Name Not Lan ID (https://www.excelbanter.com/excel-programming/370650-real-users-name-not-lan-id.html)

Lime

Real Users Name Not Lan ID
 
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

NickHK[_3_]

Real Users Name Not Lan ID
 
Need some API work, but a VB example
http://vbnet.mvps.org/index.html?cod...sergetinfo.htm

NickHK

"Lime" ...
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




Michel Pierron

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





All times are GMT +1. The time now is 11:26 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com