the (NOW) command inserts the system time. Is there a way to insert the user name of the person logged on to a xp machine?
insert username
Collapse
X
-
Tags: None
-
try to use this
[code=vb]
Private Declare Function GetUserName Lib "advapi32.d ll" Alias "GetUserNam eA" (ByVal lpBuffer As String, nSize As Long) As Long
Public Function localUserName() As String
Dim m_myBuf As String * 25
Dim m_Val As Long, UserName As String
m_Val = GetUserName(m_m yBuf, 25)
localUserName = Left(m_myBuf, InStr(m_myBuf, Chr(0)) - 1)
End Function
[/code]
Comment