The following example retrieves and displays the name of the company the user is currently logged into.
Private Sub CompanyName_Click() Dim UserInfoObj As UserInfo Dim CompanyName As String 'Get the UserInfo object Set UserInfoObj = VbaGlobal.UserInfoGet() 'Retrieve and display the company name CompanyName = UserInfoObj.CompanyName MsgBox CompanyName End Sub