Novell username

F

Frank H

Can anybody help.

How can I get the name of the currently logged on Novell user

TIA
 
A

Arvin Meyer [MVP]

Try:

Function NetworkUserName () As String

Dim iStringLength As Integer
Dim sString As String * 255

iStringLength = Len(sString)
sString = String$(iStringLength, 0)

If WNetGetUser(sString, iStringLength) = 0 Then
NetworkUserName = Left$(sString, iStringLength)
Else
NetworkUserName = "Unknown"
End If

End Function
 
F

Frank H

Arvin, thanks for response

Where is WNerGetUser defined.
If I use function as you described, get Compile Error : Function or Sub not
defined (on WNetGetUser)

TIA again
 
Top