Hi,
In order to use a button to save the form and then exit InfoPath, your form
will need to be "fully trusted." For more information on creating Fully
Trusted forms, see the following:
Understanding Fully Trusted Forms
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/ipsdk/html/
ipsdkUnderstandingFullyTrustedForms.asp
If you have installed Office/InfoPath SP1, you can also create a Fully
Trusted form if you have a code-signing certificate. Regardless of the
method you choose for implementing Full Trust, here is some sample code for
saving the form to the root "C" drive and then exiting InfoPath:
XDocument.SaveAs "C:\FormName.XML"
Application.ActiveWindow.Close False
I hope this helps!
Best Regards,
Scott L. Heim
Microsoft
This posting is provided "AS IS" with no warranties, and confers no rights.