Close Infopath after hitting 'Send' using MailEnvelope - InfoPath Dev
in

InfoPath Dev

Use our Google Custom Search for best site search results.

Close Infopath after hitting 'Send' using MailEnvelope

Last post 11-09-2011 11:45 AM by Ricky. 3 replies.
Page 1 of 1 (4 items)
Sort Posts: Previous Next
  • 10-12-2011 02:04 PM

    • Ricky
    • Not Ranked
    • Joined on 08-31-2011
    • Posts 5

    Close Infopath after hitting 'Send' using MailEnvelope

    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);

    }

     

  • 10-12-2011 02:13 PM In reply to

    Re: Close Infopath after hitting 'Send' using MailEnvelope

    Here is the jscript code to close infopath when your button is clicked:

    Application.XDocuments.Close(0);

  • 10-13-2011 06:24 AM In reply to

    • Ricky
    • Not Ranked
    • Joined on 08-31-2011
    • Posts 5

    Re: Close Infopath after hitting 'Send' using MailEnvelope

     Since the MailEnvelope 'Send' button does not have my code behind it, how to I incorporate the Application.XDocuments.Close(0); code into my code? I can't have the document close before the user has the opportunity to add other emails recipients.

     

    Currently, my code just opens the MailEnvelope. After the user has added additional email recipients they click the 'Send' button on that window, the form is sent and the MailEnvelope window is closed, but my Infopath form remains.

     

    Any additional information would be helpful.

  • 11-09-2011 11:45 AM In reply to

    • Ricky
    • Not Ranked
    • Joined on 08-31-2011
    • Posts 5

    Re: Close Infopath after hitting 'Send' using MailEnvelope

     All,

     I've had this open for a while with no other responses.  I'm still having trouble finding a solution to my problem.

     Does anyone have any further insight?

Page 1 of 1 (4 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.