Hello,
please check this MSDN article
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/odc_ip2003_ta/html/odc_InfoPath_submitting_forms.asp
Check the code inside OnSubmitRequest. It's C# code, but it should give you idea how it is done.
public void OnSubmitRequest(DocReturnEvent e)
{
try
{
string reportType = thisXDocument.DOM.selectSingleNode("//my:reportType").text;
string submitDestination;
// Individual reports are e-mailed to the project manager.
if (reportType == "Individual")
{
EmailAdapter emailSubmit = (EmailAdapter)thisXDocument.DataAdapters["EmailSubmit"];
emailSubmit.Submit();
submitDestination = thisXDocument.DOM.selectSingleNode("//my:projectManager/my:emailLink").text;
}
// Summary reports are submitted to SharePoint.
else
{
DAVAdapter sharepointSubmit = (DAVAdapter)thisXDocument.DataAdapters["SharePointSubmit"];
sharepointSubmit.Submit();
submitDestination = sharepointSubmit.FolderURL;
}
thisXDocument.UI.Alert("The form has been successfully submitted to " + submitDestination + ".");
e.ReturnStatus = true;
}
catch (System.Exception ex)
{
thisXDocument.UI.Alert("Could not submit " + ex.Message);
e.ReturnStatus = false;
}
}
Stephanie Cantwell / Test ManagerQdabra® Software / Streamline data gathering to turn process into knowledge