Wscript Error, please help!! - InfoPath Dev
in

InfoPath Dev

Wscript Error, please help!!

Last post 04-25-2007 09:35 PM by K.Ramana Reddy. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 04-25-2007 07:59 AM

    Wscript Error, please help!!

    I am using the following code to pull the username of the person accessing my infopath form and insert their name into a field called Signature1:

    dim x

    var x = new ActiveXObject("Wscript.Network")

    dim user

    user = x.UserName

    XDocument.DOM.selectSingleNode("/my:myFields/my:Signature1").text = user

    When I run the form, I get the following error: 

    InfoPath cannot open the selected form because of an error in the form's code.
    The following error occurred:

    Invalid character
    File:script.vbs
    Line:17
    var x = new ActiveXObject("Wscript.Network");

    Any ideas???

  • 04-25-2007 09:35 PM In reply to

    Re: Wscript Error, please help!!

    Hi,

    I think you are using VbScript,

    For VBscript you have to use dim for variable declaration not the var and don't use the ; end of the statement.

    I tried the following code it is worked for me, try with that one.

    Dim X

    set X = createobject("WSCRIPT.Network") 

    XDocument.DOM.selectSingleNode("/my:myFields/my:field1").text=X.UserName

    I hope this will work for you.

    K.Ramana Reddy / http://www.ggktech.com
    India.
Page 1 of 1 (2 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.