Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / August 2007

Tip: Looking for answers? Try searching our database.

getting user name from active directory

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Joanne - 22 Aug 2007 19:44 GMT
Hello,
I'd like to be able to grab the user first name and last name from Active
Directory, to place in a form I've created.  I'm not sure what kind of
connection to set up.

Thank you for any help you can provide.
Jean-Guy Marcil - 26 Aug 2007 23:41 GMT
Joanne was telling us:
Joanne nous racontait que :

> Hello,
> I'd like to be able to grab the user first name and last name from
> Active Directory, to place in a form I've created.  I'm not sure what
> kind of connection to set up.
>
> Thank you for any help you can provide.

See this thread for more info:
   http://tinyurl.com/2owxbh

Here is something to get you going:

   Dim objAdSys, objUser
   Set objAdSys = CreateObject("ADSystemInfo")
   Set objUser = GetObject("LDAP://" & objAdSys.UserName)

   MsgBox (objUser.Get("cn"))
   MsgBox (objUser.Get("distinguishedName"))
   MsgBox (objUser.Get("displayName"))
   MsgBox (objUser.Get("initials"))
   MsgBox (objUser.Get("mail"))
   MsgBox (objUser.Get("department"))
   MsgBox (objUser.Get("company"))
   MsgBox (objUser.Get("title"))

Signature

Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
jmarcilREMOVE@CAPSsympatico.caTHISTOO
Word MVP site: http://www.word.mvps.org

Joanne - 27 Aug 2007 13:48 GMT
Merci!
Vous etes un ange!

> Joanne was telling us:
> Joanne nous racontait que :
[quoted text clipped - 23 lines]
>     MsgBox (objUser.Get("company"))
>     MsgBox (objUser.Get("title"))
Jean-Guy Marcil - 28 Aug 2007 02:14 GMT
Joanne was telling us:
Joanne nous racontait que :

> Merci!
> Vous etes un ange!

I know... If only I could convince my wife of the same!
;-)

Glad I could help.

Signature

Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
jmarcilREMOVE@CAPSsympatico.caTHISTOO
Word MVP site: http://www.word.mvps.org

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.