Retreiving user information from AD

H

Hasse

Hi,

I have a short OnLoad VB Script in my InfoPath form that retrieves
information from our AD to fill in the fields UserName and e-mailaddress from
the user who is filling out the form. It works allmost for everyone but for
som users it don't.
The form is in a Form Library in a WSS site.
Can it be some settings in IE that causes the problem or what?
Any suggestions to solve this problem is greatly appreciated.
This is how my code looks:
Sub XDocument_OnLoad(eventObj)
Set sysinfo = CreateObject("ADSystemInfo")
Set oUser = GetObject("LDAP://" & sysinfo.UserName & "")
On Error Resume Next
If XDocument.DOM.selectSingleNode("//my:Status").text = "New" Then
XDocument.DOM.selectSingleNode("//my:UserName").text = oUser.displayName
XDocument.DOM.selectSingleNode("//my:e-mailaddress").text = oUser.mail
XDocument.DOM.selectSingleNode("//my:Status").text = "New"
End If
End Sub

Regards,
Hans
 

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