Converting User IDs to User Name
I developed this code to return the User Name. You might want to
revise it so it picks up its input from a range rather than an
INPUTBOX statement.
Regards
Greg
Sub ReturnUserNamefromID()
'This routine returns the Outlook Common Name from the known User
ID
Dim UserID As String
Dim OutObj As New Outlook.Application
Dim Mail As Object
Set Mail = OutObj.CreateItem(0)
UserID = InputBox("Enter the UserID", "Email Lookup")
Mail.To = UserID
If Mail.Recipients.ResolveAll Then
MsgBox Mail.To
Else
Debug.Print Mail.To & " did not resolve"
End If
Set Mail = Nothing
End Sub
|