Close Infopath after 'Send with MailEnvelope' - InfoPath Dev
in

InfoPath Dev

Use our Google Custom Search for best site search results.

Close Infopath after 'Send with MailEnvelope'

Last post 02-06-2012 08:21 AM by Ricky. 7 replies.
Page 1 of 1 (8 items)
Sort Posts: Previous Next
  • 04-10-2006 11:17 AM

    Close Infopath after 'Send with MailEnvelope'

    Hello,

    I have the problem that I want to close Infopath at all AFTER I have sent a form. For sending my form I use the MailEnvelope object.

    My code looks like:

    var oEnvelope = XDocument.View.Window.MailEnvelope;
    oEnvelope.To = "Mailaddress";
    oEnvelope.Subject = "Subject";
    oEnvelope.Visible = true;

    Application.ActiveWindow.Close(true);
    My problem at this point is that Infopath don´t wait until the user has clicked "Send" but closes Infopath immediately without waiting for the user until he has clicked "Send".

    Does anyone know a way that I can force Infopath waiting so long until the user has sent the form.

    Thank you very much for your help.
    Karsten
  • 04-14-2006 09:43 PM In reply to

    Re: Close Infopath after 'Send with MailEnvelope'

    Didn't you have oEnvelope.Submit() before closing the window?
    Also where did you put these codes? It should be in the OnClick event handler of the "Send" button.
  • 04-16-2006 12:01 AM In reply to

    Re: Close Infopath after 'Send with MailEnvelope'

    Hi Karsten,
    Chinhnc is right - you need to correct your code to do a submit. But, I have a bigger question: why se code at all for this? You can define rules on a button that submit and then close the form. That should be easier.
    Patrick Halstead
    Project Manager at Qdabra
  • 04-16-2006 02:40 AM In reply to

    Re: Close Infopath after 'Send with MailEnvelope'

    Hi Patrick, hi chinhnc,

    thanks for your advice. Yes, I have thought about the solution to use rules that submit and close the form. But if I use this way I miss that the form is shown as a preview in the body of the email.

    But --- Is it right that using the MailEnvelope object is the only way to show the preview of the form in the emal body or is there another way to do this?

    Regards,
    Karsten
  • 04-19-2006 03:06 AM In reply to

    • PCM
    • Not Ranked
    • Joined on 04-10-2006
    • Posts 3

    Re: Close Infopath after 'Send with MailEnvelope'

    I have the same problem. One of the reasons to use the envelope could be that you can attach mail elements from outlook, like other mails.

    Best regards
  • 04-19-2006 11:09 PM In reply to

    Re: Close Infopath after 'Send with MailEnvelope'

    Karsten, you can call code from the rules in the Condition using xdExtension.

    http://blogs.msdn.com/infopath/archive/2005/06/17/430347.aspx
    Patrick Halstead
    Project Manager at Qdabra
  • 04-20-2006 01:39 AM In reply to

    Re: Close Infopath after 'Send with MailEnvelope'

    Hi Patrick,

    thanks for pointed me to the above mentioned link.
    But at the moment I don´t know how I can use this tip from the 'Infopath Team Blog'. Even if I use the MailEnvelope object in the 'XDocument::OnSubmitRequest' function and I have set the option 'close form after submit' the form closes immediately without waiting for the user pressing the 'send' button.

    Regards,
    Karsten
  • 02-06-2012 08:21 AM In reply to

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

    Re: Close Infopath after 'Send with MailEnvelope'

     Karsten,

     This is an old string, but I have been looking for the same answers for over 6 months (off and on). Did you ever find out how to close Infopath after hitting Send on the MailEnvelope popup?

    Thanks for any help you can offer. 

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