display name of current user

A

Andrej Zafosnik

We are having problems with publishing AD information into the form Text
Box control field.

VB-script that we use to get Display Name of currently logged on AD-User:
___
On Error Resume Next
Set objUser = GetObject("LDAP://" & objADSystemInfo.UserName)
'WScript.Echo "Display Name: " & objUser.DisplayName <= just to check if
objUser.DisplayName has the right value.
___

We tried to add the OnLoad event for Text Box field in MS Script Editor. The
text we would like to show in this Text Box field is objUser.DisplayName
(current user).

Here is the code we use, to show informations on Infopath form via MS
Script Editor. It does displays the text in a form.
___
Dim objXML
Set objXML = XDocument.DOM.selectSingleNode("//my:field1")
objXML.text = "Text we want to display"
XDocument.View.ForceUpdate()
___

But when we add AD info it does not work
___
Dim objXML
Dim objADSystemInfo
Dim objUser
Set objXML = XDocument.DOM.selectSingleNode("//my:field1")
Set objADSystemInfo = CreateObject("ADSystemInfo")
Set objUser = GetObject("LDAP://" & objADSystemInfo.UserName)
objXML.text = objUser.DisplayName
XDocument.View.ForceUpdate()
___

Any ideas?
Andrej
 
R

Rok

We tried this work-around with web service. Web service is working OK (we
tested it through IE) and is on address:
http://localhost/ADService/Service1.asmx.

We still got problems with getting values that webservice returns. We are
working in vbscript (VBA) - codebehind infopath form. In all examples that
you have sent is supposted that you work in Visual Studio .NET (2003 or
2005). Is there a way to acquire webservice's values from vbscript (vba)?

Thanks.

Regards,
Rok
 
A

Andrej

Hi we managed to solve the problem. We put the infopath form's security
level in full trust and it started to worke.

Andrej
 

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

Similar Threads


Top