Hi all,
I'm using MailEnvelope to send an Infopath form; however, I'm having trouble finding a way to close the application after hitting the 'Send' button. The active window (being the MailEnvelope window) will close upon sending, but this is causing some people to send it again not knowing that it has already been sent.
I've seen multiple pages dealing with something similar, but they all suggest using a submit button with a Rule behind it. My department prefers the MailEnvelope, therefore that it what we're using.
Does anyone know what the script would be to close the form when the 'Send' button is clicked?
This is what I currently have:
function ctlSubmit::OnClick(eventObj)
{
try
{
var oEnvelope = Application.ActiveWindow.MailEnvelope;
var objReport = XDocument.DOM.selectSingleNode("//my:myFields/my:report_name_blank");
oEnvelope.Subject = "My Form";
oEnvelope.To = "someone@somewhere.com"
oEnvelope.Visible = true;
}
catch(ex)
{
XDocument.UI.Alert(ex.description);
}
}