How can I pull current user info into a custom outlook form?
"Jenn" wrote in message
...
I am creating a custom form in Outlook and would like to pull in the
current
Users Manager's name. Any suggestions on where I go to find some code to
accomplish that?
If by that you mean the user that's currently logged in to Windows, this
will do it in VB6:
Private Declare Function WNetGetUser Lib "mpr.dll" Alias "WNetGetUserA"
(ByVal lpName As String, ByVal lpUserName As String, lpnLength As Long) As
Long
Function GetLoggedInUser() As String
Dim UserName As String, Ln As Long
UserName = String$(1024, 0)
Ln = 1023
WNetGetUser vbNullString, UserName, Ln
GetLoggedInUser = UserName
End Function
-Mark
|