J
Jan Nielsen
In a Word template, I'm trying to read some attributes in AD about the
current user.
Some of these attributes should then be inserted in a letter.
So far I have the following code, which works ok.
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"))
However, as this piece of code connects to the AD it only works when the
user is online.
Does Word have some means of extracting these attributes from the user
profile (which is cached on the local computer) ???
Thanks in advance,
Jan Nielsen
current user.
Some of these attributes should then be inserted in a letter.
So far I have the following code, which works ok.
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"))
However, as this piece of code connects to the AD it only works when the
user is online.
Does Word have some means of extracting these attributes from the user
profile (which is cached on the local computer) ???
Thanks in advance,
Jan Nielsen