I recently needed to get the NT user name from VBA code. Not a problem, Microsoft have an advisory note that tells you how to do that and there's a good summary of it on this post:
http://blogs.officezealot.com/charles/archive/2004/12/10/3574.aspx
However, there is a ptentially serious security problem with the other method that Charles suggests on that post - using the environment variable like this:
Environ("USERNAME")
If you are using the username check in VBA for security purposes (for example, matching a username against a list of known users permitted or restricted on some actions) then the method above does not guarantee that the actual username of the logged on user will be returned.
The user can override the default username setting by adding a new environment variable (Control Panel -> System -> Environment Variables) called USERNAME and setting it to whatever they want. Effectively, they are taking the identity of another user as far as the variable is concerned, and anything that looks it up.
It is therefore safer from a security perspective to use the Win32 API call. Note that if you are doing security in VBA you have a bit of a problem anyway though because even if you password protect you code, it's easily crackable.