<?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: Help: Close InfoPath window in OnLoad Event</title><link>https://www.infopathdev.com:443/forums/thread/13708.aspx</link><pubDate>Fri, 07 Oct 2005 04:46:43 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:13708</guid><dc:creator>innovision</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/13708.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=13708</wfw:commentRss><description>Thank you very much~~~&lt;br /&gt;&lt;br /&gt;Your advice is very useful.</description></item><item><title>Re: Help: Close InfoPath window in OnLoad Event</title><link>https://www.infopathdev.com:443/forums/thread/13707.aspx</link><pubDate>Thu, 06 Oct 2005 18:15:50 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:13707</guid><dc:creator>Patrick Halstead</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/13707.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=13707</wfw:commentRss><description>Hi Innovision and welcome to our forum,&lt;br /&gt;I think it's bad practice to close the window on open since it could lead to a flashing behavior and bad user experience - i.e. they won't understand what happened. Better to switch them to a view and say "You don't have access to this form" or something like that. You'll want to disable save to prevent one mechanism for viewing the XML. This should be quite doable via User Roles and Open Rules (check out tabs on Tools-&amp;gt;Form Options in the InfoPath designer) and it is a good design to do this since it explains to the user why they can't see the data. Good luck!&lt;br /&gt;&lt;br /&gt;Patrick Halstead [InfoPath MVP]&lt;br /&gt;InfoPathDev</description></item><item><title>Re: Help: Close InfoPath window in OnLoad Event</title><link>https://www.infopathdev.com:443/forums/thread/13706.aspx</link><pubDate>Thu, 06 Oct 2005 01:09:12 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:13706</guid><dc:creator>franck</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/13706.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=13706</wfw:commentRss><description>well...to my knowledge you can't close the form during the OnLoad event, not during the OnSwitchView event either...&lt;br /&gt;May have to wait until the OnContextChange event is fired to attempt anything...&lt;br /&gt;&lt;br /&gt;Greg, Patrick, any thoughts in that issue?&lt;br /&gt;&lt;br /&gt;Franck Dauché</description></item><item><title>Re: Help: Close InfoPath window in OnLoad Event</title><link>https://www.infopathdev.com:443/forums/thread/13705.aspx</link><pubDate>Wed, 05 Oct 2005 21:34:01 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:13705</guid><dc:creator>innovision</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/13705.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=13705</wfw:commentRss><description>Thanks!&lt;br /&gt;&lt;br /&gt;But, authorization is not the problem here. It is more complicated than password or Windows Authentication. &lt;br /&gt;&lt;br /&gt;Is there no way to close form when opening it?</description></item><item><title>Re: Help: Close InfoPath window in OnLoad Event</title><link>https://www.infopathdev.com:443/forums/thread/13704.aspx</link><pubDate>Wed, 05 Oct 2005 14:38:34 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:13704</guid><dc:creator>franck</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/13704.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=13704</wfw:commentRss><description>Hi,&lt;br /&gt;&lt;br /&gt;One possible way to accomplish what you are trying to do is to have your form defaulting to a View where you check your user credentials (Login View).  If your user passes your test (use name / passord, etc.), you can then Switch View and go to what you currently have as a default View in your form.  Else, you can safely warn your user and close the form...&lt;br /&gt;&lt;br /&gt;Hope that it helps.&lt;br /&gt;&lt;br /&gt;Regards,&lt;br /&gt;&lt;br /&gt;Franck Dauché&lt;br /&gt;</description></item><item><title>Re: Help: Close InfoPath window in OnLoad Event</title><link>https://www.infopathdev.com:443/forums/thread/13703.aspx</link><pubDate>Wed, 05 Oct 2005 13:15:57 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:13703</guid><dc:creator>Matt Faus</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/13703.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=13703</wfw:commentRss><description>How is your InfoPath form determining whether or not some one is authorized to open the form? Password protection? Windows Authentication? If you're using Windows Authentication you could just set the permissions for the file or folder that the form is in to allow only a certain group read/execute permission. Also, there is something with InfoPath where you can digitally sign the document and require people to have certificates, but I'm not sure how this works.&lt;br /&gt;&lt;br /&gt;---------------&lt;br /&gt;Matt Faus&lt;br /&gt;</description></item><item><title>Help: Close InfoPath window in OnLoad Event</title><link>https://www.infopathdev.com:443/forums/thread/12601.aspx</link><pubDate>Wed, 05 Oct 2005 10:43:27 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:12601</guid><dc:creator>innovision</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/12601.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=12601</wfw:commentRss><description>Hi:&lt;br /&gt;&lt;br /&gt;I have a problem about closing InfoPath window. I want only some authorized people can open my InfoPath template. So I think maybe I can put some check codes in the onload event and if user is not permitted to see the form, the InfoPath window will close. &lt;br /&gt;&lt;br /&gt;I have read some topics in the forum about close InfoPath form. In summary there are 3 ways:&lt;br /&gt;&lt;br /&gt;1. Application.Quit(). &lt;br /&gt;Quit method is only used in a fully trusted form. It is not feasible for me.&lt;br /&gt;&lt;br /&gt;2. Application.ActiveWindow.Close()&lt;br /&gt;It seems this function doesn#%92t work in the onload event. I know Close() can only be used with the OnSubmitRequest and OnClick event handlers. So I add XDocument.Submit() in the onload event and put Close() in the OnSubmitRequest event. But it responds a COMException “Invalid context for the OM call”. If I use a submit button on the form to invoke OnSubmitRequest event, the Close() will work well. Why?&lt;br /&gt;&lt;br /&gt;3. XDocument.View.Window.Close()&lt;br /&gt;It never works. Shame on me.&lt;br /&gt;&lt;br /&gt;So how to use Close() when the form has not been seen?&lt;br /&gt;&lt;br /&gt;Help me please! Thanks in advanced!</description></item></channel></rss>