Hello!
I need a solution to get the username value from the registry into a infopath textfield.(name of the textfield "field1").
I work with Infopath 2003, thereforce i cannot use the "username" function.
How I modify the following code.
Sub CTRL3_5_OnClick(eventObj)
Dim Username
set wshshell = createobject("Wscript.shell")
Const strBaseKey = "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Logon User Name"
Username = wshshell.regread(strbasekey)
msgbox (Username)
Approximately (but i dont know the correct syntax) : myFields/my:field1").text = Username
End Sub
Best regards
Philipp