-
Now that you know your script works, the next thing to do is to look at how you're invoking it. You're doing it like this:
ProcId = Shell("cscript \\franklin\c$\Inetpub\wwwroot\shared\Infopath\jscript.js 8275")
You can of course try to do it differently, maybe by doing Process.Start(), passing it the full path to cscript.exe ...
-
Here is a random thought: are you sure that your production machine has InfoPath 2003 SP1 or later?
I believe InfoPath 2003 RTM simply does not expose InfoPath.Application
If you're running the RTM version of InfoPath then this is your problem
-
Strange... maybe some .NET permissions problems that prevent you from executing scripts on the production machine? It's a wild guess, really. Normally you should get an exception if it doesn't like you.
Since you are doing a shell exec, try to do a start | run on your production machine and paste the command there - see what happens.
-
Well, it's pretty hard to debug pasted code especially when it is known to work on one environment but not the other, but maybe a couple of pointers:
- Make sure the InfoPath process get started when you execute the script
- Try and see if you can replace cscript with wscript. Then add WScript.Echo() lines throughout your javascript code. ...
-
If you have MSDN Universal, try to look for something named en_InfoPath_toolkit_vsto_2005.iso
-
Didn't you comment out the line that starts the script in your code? :)
-
I have an impression that your configuration kind of fell through the cracks for the free downloadable toolkits support... here is how I picture it:
1. Visual Studio .NET + InfoPath 2003 - you can download a free development toolkit
2. Visual Studio 2005 + InfoPath 2007 - you can download free VSTO 2005 SE
So the only configuration for ...
-
Are you running InfoPath 2003? I think it has some issues with closing from code. Is your code running from the taskpane?
-
Yes, the only thing that won't work in your code is xdXDocument:GetDOM() because you don't have an XSLT processor where this function is defined.
However, there is an equivalent you can use in code:
XDocument.GetDOM(domName)
So your code then becomes ...
-
The last line of your post is unfortunately your problem. Command line arguments are only supported in InfoPath 2003.
See this forum post for some IP2003 workarounds:
http://www.infopathdev.com/forums/post/20383.aspx