Hello,
...in the meantime I have found a solution which I want to share for anyone who is interested in.
The problem in my code was the correct declaration of the namespace.
If you don´t declare the -really- exact namespace for the property 'SelectionNamespaces' the above mentioned code will failed.
You can determine the exact namespace definition for the used form template with the method 'namespaceURI' as I show in the following line:
var oXMLDocNamespace = oXMLDocument.selectSingleNode("/*[1]").namespaceURI;
Now you can set the correct value for the 'SelectionNamespaces' property:
oXMLDocument.setProperty("SelectionNamespaces","xmlns:my='" + oXMLDocNamespace + "'");
So, the whole working code looks like...
var oApp = new ActiveXObject("InfoPath.Application");
var oXDocumentCollection = oApp.XDocuments;
var oXDocument = oXDocumentCollection.NewFromSolution("file:///C:\\Mytemplate.xsn");
var oXMLDocument = oXDocument.DOM;
var oXMLDocNamespace = oXMLDocument.selectSingleNode("/*[1]").namespaceURI;
oXMLDocument.setProperty("SelectionNamespaces","xmlns:my='" + oXMLDocNamespace + "'");
oXMLDocument.selectSingleNode("//my:myFields//my:singleFieldname").text = "This is a new value";
HTH,
Karsten