<?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: Close a form with code - URGENT!</title><link>https://www.infopathdev.com:443/forums/thread/13385.aspx</link><pubDate>Fri, 22 Jul 2005 05:48:33 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:13385</guid><dc:creator>SherazAttari</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/13385.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=13385</wfw:commentRss><description>Try,&lt;br /&gt;&lt;br /&gt;thisApplication.ActiveWindow.Close(true);&lt;br /&gt;&lt;br /&gt;-Attari-</description></item><item><title>Re: Close a form with code - URGENT!</title><link>https://www.infopathdev.com:443/forums/thread/13384.aspx</link><pubDate>Thu, 21 Jul 2005 20:53:53 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:13384</guid><dc:creator>Agni Jonnalagadda</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/13384.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=13384</wfw:commentRss><description>Hi Matrix,&lt;br /&gt;This might work for you to close the current window&lt;br /&gt;XDocument.View.Window.Close(true);&lt;br /&gt;&lt;br /&gt;Agni&lt;br /&gt;InfoPath Dev India</description></item><item><title>Re: Close a form with code - URGENT!</title><link>https://www.infopathdev.com:443/forums/thread/13383.aspx</link><pubDate>Thu, 21 Jul 2005 18:12:03 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:13383</guid><dc:creator>Matrix333</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/13383.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=13383</wfw:commentRss><description>ok, i found that this might work:&lt;br /&gt;Application.XDocuments.Close(0)&lt;br /&gt;&lt;br /&gt;but if i hard code that into the form code...maybe it will close the first form, but what happens when it tries to close the second form after you press submit?  then wouldnt it have to be (1) ?</description></item><item><title>Close a form with code - URGENT!</title><link>https://www.infopathdev.com:443/forums/thread/12505.aspx</link><pubDate>Thu, 21 Jul 2005 16:48:40 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:12505</guid><dc:creator>Matrix333</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/12505.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=12505</wfw:commentRss><description>Please respond ASAP!!&lt;br /&gt;&lt;br /&gt;I have a form that when you click submit:&lt;br /&gt;It is submitted to a sharepoint library (formA)&lt;br /&gt;a new form is opened (formB)&lt;br /&gt;the form code runs (formA)&lt;br /&gt;then it closes (formA)&lt;br /&gt;&lt;br /&gt;i tried putting the Close in a rule, but it ran the rules before it ran the custom code.  so i tried putting this at the bottom of my code on FormA:&lt;br /&gt;&lt;br /&gt;Application.XDocuments.Close(XDocument)&lt;br /&gt;&lt;br /&gt;This seems to work fine, but then on the new form that is opened...the rules do not run when i press submit (i think the code does though)&lt;br /&gt;&lt;br /&gt;is there a different way to close FormA using code?  a way that will make all this work like it is supposed to?</description></item></channel></rss>