Hello,
you can do this from within the script file (Note: This example is in C#,
but you can use JScript in a similar way).
// The url of the second form, must be absolute (i.e. c:\myforms\form.xsn).
This example opens a form that lies in the same directory as the source form
url = XDocument.Solution.URI;
url =
HttpUtility.UrlDecode(url.Substring(url.IndexOf("://")+4)).Replace("/",
"\\");
url = Path.Combine(Path.GetDirectoryName(url), "News Template.xsn");
// Open a new instance of the second xsn
doc = Application.XDocuments.NewFromSolution(url);
// Get the Datasource of the second form. Note: In Jscript you won't need
the casting to the IXMLDOMDocument2
dom = (IXMLDOMDocument2) doc.DOM;
// Set the namespace to the one used within the second document
dom.setProperty("SelectionNamespaces",
"xmlns:my=\
http://schemas.microsoft.com/office/infopath/2003/myXSD/2005-06-05T13:36:27\");
// Set the value
doc.DOM.selectSingleNode("//my:integervalue").text = 42;
Greetings,
Henning Krause [MVP - Exchange]
==========================
Visit my website:
http://www.infinitec.de
Try my free Exchange Explorer: Mistaya
(
http://www.infinitec.de/software/mistaya.aspx)