|
Visual Basic (VB and VBA) |
|
Copyright 1999-2001 Christopher Greaves. All rights reserved. Home Page and email to [email protected] |
| If in doubt, record a macro and inspect the entrails! |
Please read the DISCLAIMER.
Here is an INDEX to all the procedures.
You will probably need one copy of my GLOBAL DECLARATIONS.
Public Function strGetUserInfo() As String
' Procedure : strGetUserInfo
' Description: Return a delimited string of user variable data.
' Copyright: Chris Greaves Inc.
' Inputs:
' Returns: STRING; first char is the delimiter
' Assumes: Nothing
' Side Effects:
' Tested: By the calls listed below.
Dim strResult As String
strResult = ""
Dim vOS As String
vOS = Application.System.OperatingSystem
strResult = strResult & strcArrayDelimiter & vOS
If vOS = "Windows NT" Then 'And Win2000
strResult = strResult & strcArrayDelimiter & UCase(System.PrivateProfileString(FileName:="", Section:= _
"HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer", Key:="Logon User Name"))
Else
strResult = strResult & strcArrayDelimiter & UCase(System.PrivateProfileString _
(FileName:="", Section:="HKEY_LOCAL_MACHINE\Network\Logon", Key:="UserName"))
strResult = strResult & strcArrayDelimiter & Left$(Environ("Windir"), 2)
End If
strGetUserInfo = strResult
'Sub TESTstrGetUserInfo()
'MsgBox strGetUserInfo
'End Sub
End Function
| We all knew nothing when we started … |
|
Home Page and Contact Information Send email to [email protected]. This page was last updated Thursday, November 15, 2001 |