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