R
rahul
I am trying to automate Infopath through c#. Through this external code i am
able to launch Infopath application and change the data.
The only thing which I am not able to do is capture the save submit or close
event. My requirement is to get the xml data stored in the infopath form
when the user is done with editing.
The code piece is:
myApp = new Microsoft.Office.Interop.InfoPath.Application();
InfoPath.XDocument myXDoc = myApp.XDocuments.Open(@"C:\Documents and
Settings\raverma\Desktop\test2.xml",
(int)InfoPath.XdDocumentVersionMode.xdFailOnVersionOlder);
InfoPath._XDocument2 x2 = myXDoc as InfoPath._XDocument2;
//myXDoc.OnSubmitRequest += new
InfoPath._XDocumentEventSink2_OnSubmitRequestEventHandler(myXDoc_OnSubmitRequest);
//myXDoc.OnSaveRequest += new
Microsoft.Office.Interop.InfoPath._XDocumentEventSink2_OnSaveRequestEventHandler(myXDoc_OnSaveRequest);
//myXDoc.OnLoad += new
Microsoft.Office.Interop.InfoPath._XDocumentEventSink2_OnLoadEventHandler(myXDoc_OnLoad);
//InfoPathXml.IXMLDOMDocument2 domo = myXDoc.CreateDOM() as
InfoPathXml.IXMLDOMDocument2;
able to launch Infopath application and change the data.
The only thing which I am not able to do is capture the save submit or close
event. My requirement is to get the xml data stored in the infopath form
when the user is done with editing.
The code piece is:
myApp = new Microsoft.Office.Interop.InfoPath.Application();
InfoPath.XDocument myXDoc = myApp.XDocuments.Open(@"C:\Documents and
Settings\raverma\Desktop\test2.xml",
(int)InfoPath.XdDocumentVersionMode.xdFailOnVersionOlder);
InfoPath._XDocument2 x2 = myXDoc as InfoPath._XDocument2;
//myXDoc.OnSubmitRequest += new
InfoPath._XDocumentEventSink2_OnSubmitRequestEventHandler(myXDoc_OnSubmitRequest);
//myXDoc.OnSaveRequest += new
Microsoft.Office.Interop.InfoPath._XDocumentEventSink2_OnSaveRequestEventHandler(myXDoc_OnSaveRequest);
//myXDoc.OnLoad += new
Microsoft.Office.Interop.InfoPath._XDocumentEventSink2_OnLoadEventHandler(myXDoc_OnLoad);
//InfoPathXml.IXMLDOMDocument2 domo = myXDoc.CreateDOM() as
InfoPathXml.IXMLDOMDocument2;