<?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>Code</title><link>https://www.infopathdev.com:443/forums/45.aspx</link><description /><dc:language>en</dc:language><generator>CommunityServer 2007 SP3 (Build: 31118.962)</generator><item><title>Re: Using this.close() after submit</title><link>https://www.infopathdev.com:443/forums/thread/88409.aspx</link><pubDate>Wed, 27 Mar 2013 09:14:02 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:88409</guid><dc:creator>HHearle</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/88409.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=88409</wfw:commentRss><description>&lt;p&gt;Why not try sendkeys?&lt;/p&gt;
&lt;p&gt;var WshShell = new ActiveXObject(&amp;quot;WScript.Shell&amp;quot;);&amp;nbsp;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;WshShell.SendKeys(&amp;quot;%fx&amp;quot;)&lt;/p&gt;
&lt;p&gt;&amp;nbsp;Since code alway runs after rules?&amp;nbsp; This would close the whole program (but I think this is only Javascript- I presume this is what you are using) :p&lt;/p&gt;</description></item><item><title>Re: Using this.close() after submit</title><link>https://www.infopathdev.com:443/forums/thread/84748.aspx</link><pubDate>Mon, 26 Nov 2012 21:30:58 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:84748</guid><dc:creator>Doreen</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/84748.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=84748</wfw:commentRss><description>&lt;p&gt;I found a solution.&amp;nbsp; &lt;/p&gt;&lt;p&gt;Replace this code:&amp;nbsp;this.Close(): with this code: &lt;em&gt;this.Application.ActiveWindow.Close();&lt;/em&gt; and place it in a try/catch/finally to catch NullReferenceException.&lt;/p&gt;</description></item><item><title>Using this.close() after submit</title><link>https://www.infopathdev.com:443/forums/thread/84739.aspx</link><pubDate>Mon, 26 Nov 2012 18:59:56 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:84739</guid><dc:creator>Doreen</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/84739.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=84739</wfw:commentRss><description>&lt;p&gt;I am using IP 2007. Forms opens on client machine. I am using one button to do multiple things: &lt;/p&gt;&lt;p&gt;1) switch to another view (using rules), then &lt;/p&gt;&lt;p&gt;2) print the form (in code behind (this.print())), &lt;/p&gt;&lt;p&gt;3) submit the form (this.submit())&lt;/p&gt;&lt;p&gt;4) close the form(this.close()).&lt;/p&gt;&lt;p&gt;The problem is the form closes, but Infopath (the application) stays open and presents the &amp;quot;Getting Started&amp;quot; window to boot.&amp;nbsp; This will confuse my users.&amp;nbsp; How can I, through code, close the form AND the application?&lt;/p&gt;</description></item></channel></rss>