Thanks Greg,
I'm making progress. I have implemented the following script successfully:
{
var fso = new ActiveXObject("Scripting.FileSystemObject");
var FileObject = fso.OpenTextFile("\\\\Eaglet\\Share\\Test.txt", 2, true,0);
FileObject.Write("Hello Baby");
FileObject.Close()
}
My problem now is that I don't know how to substitute \\\\Eaglet\\Share\\Test.txt with a field from the form (which contains a path and filename based on a Master Template for the user's domain. I have tried to use the following...
XDocument.DOM.selectSingleNode("/my:myFields/my:ExportDetails/my:ExportPath/my:Test").text
...where my:Test contains the path and filename. I get an error message "Infopath cannot complete this action, because of an error in the form's code".
Any suggestions?
BTW I'm not sure why, but using double backslashes in the above script was the only way to get it to work. The field designated by my xpath statement also has double backslashes.
Regards - Phil