Thanks for the help. Thus far I have the code as follows. I am working with C# and InfoPath 2007:
[InfoPathEventHandler(MatchPath = "btnSubmit", EventType = InfoPathEventType.OnClick)]
public void btnSubmit_OnClick(DocActionEvent e)
{
IXMLDOMProcessingInstruction oXML = thisXDocument.DOM.createProcessingInstruction("xml", "version=\"1.0\" encoding=\"UTF-8\"");
IXMLDOMProcessingInstruction oPI = thisXDocument.DOM.createProcessingInstruction("mso-application", "progid=\"InfoPath.Document\"");
thisXDocument.DOM.insertBefore((IXMLDOMNode)oPI, thisXDocument.DOM.firstChild);
thisXDocument.DOM.insertBefore((IXMLDOMNode)oXML, thisXDocument.DOM.firstChild);
// Open a solution from a XML DOM
// Create a new DOM
IXMLDOMDocument newDoc = thisXDocument.CreateDOM();
string myXml = "<txtInput></txtInput>";
newDoc.loadXML(myXml);
// Call NewSolutionWithData to open a new Form and load the XML
XDocument oXdpostingForm = thisApplication.XDocuments.NewFromSolution(@"C:\Program Files\bSOLVe_LS_Publish\PassingParameters.xsn");
XDocument oXdreceivingForm = thisApplication.XDocuments.NewFromSolutionWithData
("C:\\Program Files\\bSOLVe_LS_Publish\\Source_ParametersReceived\\template.xml",
@"C:\Program Files\bSOLVe_LS_Publish\ParametersReceived.xsn",
(int)XdDocumentVersionMode.xdFailOnVersionOlder);
To continue with the problem - I design the form in one folder and publish and install it in another form. I get the following exception though?
InfoPath cannot create a new, blank form.
The system cannot find the path specified.
at Microsoft.Office.Interop.InfoPath.SemiTrust.XDocumentsCollectionWrapper.NewFromSolutionWithData
(Object varXMLData, Object varSolutionURI, Int32 dwBehavior)
PLEASE HELP!