Getting (internal) sender's account ID (userID)

K

ker_01

I've got some basic code that scrapes email sender, subject, and some
selected line contents and dumps them into Excel.

That data is then edited and uploaded into our Learning Management System
(LMS). In order to be uploaded, each record needs to include the employee's
numeric employee ID. The reference table I have that includes employee ID
also has their userID, but does not match up with with general sender name
due to the use of nicknames, maiden names, etc.

Given that these are internal employees in our own activedirectory(?), is
there any way to get Outlook to return the EmployeeID of the sender via VBA?

For example: I can draft an email inclduing recipients. If I right-click the
name of a recipient and click properties, the data I want to grab is contents
of the field "Alias" on the General tab. I don't know if that is included in
any hidden fields in the inbound email, or if I'd need a way to ping the
directory with each name to get the alias.

Note: it may be possible that we'd have two different people with the same
first and last name; their userID/alias and full email address would be
unique, but I can't guarantee that their common names would be unique, so any
ping might result in multiple returns, which further complicates this.

Can getting the alias/userID be done with VBA, and if so, can anyone give me
any pointers (what to look for in the help files, etc)? I'm not familiar with
the Outlook object model, but I'm willing to learn.

Thank you!
Keith
 
K

ker_01

For reference, I'm writing the code on an 2003 machine, but it is intended to
also be used on 2007 machines.
 
K

Ken Slovak - [MVP - Outlook]

You'd need to use an LDAP query to query the AD to get any internal data
like that. It really has nothing to do with Outlook. You can search for
information on LDAP queries to see how you will need to set up the query and
you'd need to know the internal data fields you want to query.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top