Advertisement
1_2002 Miscellaneous #105817

Get current Outlook user

Retrieve the user currently logged on in the existing Microsoft Outlook session.

AI

AI Summary: This codebase represents a historical implementation of the logic described in the metadata. Our preservation engine analyzes the structure to provide context for modern developers.

Source Code
original-source
Private Sub cmdUser_Click()
'get the user from the current Outlook session
Dim ol As Outlook.Application
Dim ns As NameSpace
Dim oRec As Recipient
Set ol = New Outlook.Application
Set ns = ol.GetNamespace("MAPI")
Call ns.Logon(, , , False)
Set oRec = ns.CurrentUser
MsgBox oRec.Name
End Sub
Original Comments (3)
Recovered from Wayback Machine