Hi all,
thank you for reply.
Greg, I have hear your answer, but my code don't work yet. I list here my code:
######################################################à
Sub XDocument_OnSubmitRequest(eventObj)
sStart1 = XDocument.DOM.selectSingleNode("//my:start1").text
sStart2 = XDocument.DOM.selectSingleNode("//my:start2").text
'Application.XDocuments.NewFromSolution("urn:Bravo:Raoul")
Set objNewDoc = Application.XDocuments.NewFromSolution("urn:Bravo:Raoul")
objNewDoc.DOM.selectSingleNode("//campo1").text = sStart1
objNewDoc.DOM.selectSingleNode("//campo2").text = sStart2
End Sub
#############################################
Alfa.xsn is starting form, and it contain this code. In it there are two fields named Start1 and Start2, and they are correctly read by initial code (sStart1 and sStart2 contain right values).
Bravo.xsn have two text fields only (campo1 and campo2).
I have transform third line in a comment because of fourth line, that appair to open also new form. I have also tryed with it, but no difference about error occurs.
Error occur on line
objNewDoc.DOM.selectSingleNode("//campo1").text = sStart1
Error message (in italian) is:
"Errore di run-time di microsoft VBScript. Necessario oggetto: 'objNewDoc.DOM.selectStringNode(...)"
If I modify line like
objNewDoc.DOM.selectSingleNode("//my:campo1").text = sStart1
Error message change in:
"MSXML5.dll: riferimento a un prefisso dello spazio dei nomi non dichiarato: 'my'."
I suppose that field campo1 is not find, but I dont't know why. If you have an email address, for you convenience I can send you my code.
Thank you. Raoul
p.s.: possible Namespaces problems? This is my definition:
XDocument.DOM.setProperty "SelectionNamespaces", "xmlns:my=""http://schemas.microsoft.com/office/infopath/2003/myXSD/2006-06-23T08:54:55"""