Steps to Reproduce the Problem
- Design a new, blank form template in InfoPath.
- Save the template as Test.xsn to a network share that you have write access to.
- On the File menu, click Fill Out a Form. In the Fill Out a Form task pane, select test.
- On the File menu, click Save. Save the form to your local computer as C:\testform.xml.
- Quit InfoPath.
- Start Notepad, and then copy the following script to a new file that you name Test.js.
objIP = new ActiveXObject("InfoPath.ExternalApplication")
//Open an InfoPath form.
objIP.Open ("C:\\testform.xml")
- In Windows Explorer, double-click Test.js to run the script.
Note You receive the run-time error message that is mentioned in the "Symptoms" section.
To work around this problem, replace the script in Test.js with the following script:
var WshShell = new ActiveXObject("WScript.Shell");
WshShell.Run("c:\\testform.xml");
Now when you run the script, InfoPath opens Testform.xml without error.