<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://www.infopathdev.com:443/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>General</title><link>https://www.infopathdev.com:443/forums/41.aspx</link><description>If you're not sure where to ask your question, ask it here. If necessary, our moderators will make sure it gets classified in the correct board.</description><dc:language>en</dc:language><generator>CommunityServer 2007 SP3 (Build: 31118.962)</generator><item><title>Re: Close Infopath after hitting 'Send' using MailEnvelope</title><link>https://www.infopathdev.com:443/forums/thread/71904.aspx</link><pubDate>Wed, 09 Nov 2011 19:45:21 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:71904</guid><dc:creator>Ricky</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/71904.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=71904</wfw:commentRss><description>&lt;p&gt;&amp;nbsp;All,&lt;/p&gt;&lt;p&gt;&amp;nbsp;I&amp;#39;ve had this open for a while with no other responses.&amp;nbsp; I&amp;#39;m still having trouble finding a solution to my problem.&lt;/p&gt;&lt;p&gt;&amp;nbsp;Does anyone have any further insight? &lt;br /&gt;&lt;/p&gt;</description></item><item><title>Re: Close Infopath after hitting 'Send' using MailEnvelope</title><link>https://www.infopathdev.com:443/forums/thread/71089.aspx</link><pubDate>Thu, 13 Oct 2011 13:24:24 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:71089</guid><dc:creator>Ricky</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/71089.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=71089</wfw:commentRss><description>&lt;p&gt;&amp;nbsp;Since the MailEnvelope &amp;#39;Send&amp;#39; button does not have my code behind it, how to I incorporate the Application.XDocuments.Close(0); code into my code? I can&amp;#39;t have the document close before the user has the opportunity to add other emails recipients. &lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Currently, my code just opens the MailEnvelope. After the user has added additional email recipients they click the &amp;#39;Send&amp;#39; button on that window, the form is sent and the MailEnvelope window is closed, but my Infopath form remains. &lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Any additional information would be helpful.&lt;br /&gt;&lt;/p&gt;</description></item><item><title>Re: Close Infopath after hitting 'Send' using MailEnvelope</title><link>https://www.infopathdev.com:443/forums/thread/71067.aspx</link><pubDate>Wed, 12 Oct 2011 21:13:41 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:71067</guid><dc:creator>Lockdown</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/71067.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=71067</wfw:commentRss><description>&lt;p&gt;Here is the jscript code to close infopath when your button is clicked:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;
&lt;table&gt;

&lt;tr&gt;
&lt;td&gt;&lt;pre&gt;&lt;code&gt;Application.XDocuments.&lt;strong class="bterm"&gt;Close&lt;/strong&gt;(0);&lt;/code&gt;&lt;/pre&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/p&gt;&lt;/blockquote&gt;</description></item><item><title>Close Infopath after hitting 'Send' using MailEnvelope</title><link>https://www.infopathdev.com:443/forums/thread/71065.aspx</link><pubDate>Wed, 12 Oct 2011 21:04:18 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:71065</guid><dc:creator>Ricky</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/71065.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=71065</wfw:commentRss><description>&lt;p&gt;Hi all,&lt;/p&gt;&lt;p&gt; I&amp;#39;m using MailEnvelope to send an Infopath form; however, I&amp;#39;m having trouble finding a way to close the application after hitting the &amp;#39;Send&amp;#39; 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. &lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;I&amp;#39;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&amp;#39;re using.&amp;nbsp; &lt;br /&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Does anyone know what the script would be to close the form when the &amp;#39;Send&amp;#39; button is clicked? &lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;This is what I currently have: &lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;function ctlSubmit::OnClick(eventObj)
&lt;/p&gt;&lt;p&gt;{
  &lt;/p&gt;&lt;p&gt;&amp;nbsp;try
   &lt;/p&gt;&lt;p&gt;{&lt;/p&gt;&lt;p&gt;
   var oEnvelope = Application.ActiveWindow.MailEnvelope;
   &lt;/p&gt;&lt;p&gt;var objReport = XDocument.DOM.selectSingleNode(&amp;quot;//my:myFields/my:report_name_blank&amp;quot;);
   &lt;/p&gt;&lt;p&gt;
   oEnvelope.Subject = &amp;quot;My Form&amp;quot;;
   &lt;/p&gt;&lt;p&gt;oEnvelope.To = &amp;quot;someone@somewhere.com&amp;quot;  
   &lt;/p&gt;&lt;p&gt;oEnvelope.Visible = true;	
   &lt;/p&gt;&lt;p&gt;}&lt;/p&gt;&lt;p&gt;
   catch(ex)
&lt;/p&gt;&lt;p&gt;   {&lt;/p&gt;&lt;p&gt;
     XDocument.UI.Alert(ex.description);
&lt;/p&gt;&lt;p&gt;     }&amp;nbsp;&lt;/p&gt;&lt;p&gt;
} &lt;br /&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item></channel></rss>