<?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 Infopath at OnAfterChange Event</title><link>https://www.infopathdev.com:443/forums/thread/14115.aspx</link><pubDate>Thu, 15 Dec 2005 09:58:48 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:14115</guid><dc:creator>Patrick Halstead</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/14115.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=14115</wfw:commentRss><description>You're right though - you don't need Full Trust. I was thinking of Save. ... Sorry ... too sleepy or something. Not thinking straight since we do this all the time.&lt;br /&gt;&lt;br /&gt;In general, you don't want to be Full Trust since it is very limiting and complicates deployment.&lt;br /&gt;&lt;br /&gt;Patrick Halstead [InfoPath MVP]&lt;br /&gt;InfoPathDev</description></item><item><title>Re: Close Infopath at OnAfterChange Event</title><link>https://www.infopathdev.com:443/forums/thread/14114.aspx</link><pubDate>Wed, 14 Dec 2005 15:00:30 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:14114</guid><dc:creator>Matt Faus</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/14114.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=14114</wfw:commentRss><description>Weird, I checked the SDK before I claimed that it didn't have to be Full Trust and it said this:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;blockquote id="quote"&gt;&lt;font size="1" face="Verdana, Arial, Helvetica" id="quote"&gt;quote:&lt;hr height="1" noshade id="quote"&gt;Close Method (XDocuments Collection)&lt;br /&gt;See Also Applies To Example Specifics&lt;br /&gt;Closes the specified Microsoft Office InfoPath 2003 form.&lt;br /&gt;&lt;br /&gt;expression.Close(ByVal varIndex As Variant)&lt;br /&gt;expression    Required. An expression that returns a reference to the XDocuments collection.&lt;br /&gt;&lt;br /&gt;varIndex Required Variant. The string value that specifies the Uniform Resource Identifier (URI) of a form, a long integer value that specifies the positional index of an XDocument object within the XDocuments collection, or a reference to an XDocument object.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Security Level&lt;br /&gt;2: Can be accessed only by forms running in the same domain as the currently open form, or by forms that have been granted cross-domain permissions.&lt;hr height="1" noshade id="quote"&gt;&lt;/font id="quote"&gt;&lt;/blockquote id="quote"&gt;&lt;br /&gt;&lt;br /&gt;I know there are other methods that close the form, such as Application.Quit() that are level 3, but I think this is because it closes the entire InfoPath application and all open forms, whereas XDocuments.Close(0) only closes one InfoPath form (which is referenced by the number passed in). For this reason, the XDocuments.Close() method can be safely used without being fully trusted. This is my understanding, please correct me if I'm wrong.&lt;br /&gt;&lt;br /&gt;Anyway, glad you figured it out zmike! Check out this tutorial for publishing signed forms to Sharepoint:&lt;a target="_blank" href=http://msdn.microsoft.com/library/default.asp?url=/library/en-us/ipsdk/html/ipsdkDeployURNFormToSharePoint_HV01086376.asp&gt;http://msdn.microsoft.com/library/default.asp?url=/library/en-us/ipsdk/html/ipsdkDeployURNFormToSharePoint_HV01086376.asp&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;---------------&lt;br /&gt;Matt Faus&lt;br /&gt;InfoPath Dev Texas&lt;br /&gt;</description></item><item><title>Re: Close Infopath at OnAfterChange Event</title><link>https://www.infopathdev.com:443/forums/thread/14113.aspx</link><pubDate>Wed, 14 Dec 2005 10:27:17 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:14113</guid><dc:creator>zmike</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/14113.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=14113</wfw:commentRss><description>Hello again!!&lt;br /&gt;I already solve the situation... ;)&lt;br /&gt;I register the Form, Fully Trusted and then use:&lt;br /&gt;&lt;br /&gt;Application.Quit(true); //To not save the form&lt;br /&gt;&lt;br /&gt;It solved, and really quits the Apllication, not only the Form.&lt;br /&gt;&lt;br /&gt;The only thing that is making me sad.. Is that to create a Fully Trusted we need to certificate the form.&lt;br /&gt;I did it, publish into a Sharepoint library... But then, when users open the form, It asks to approve the certificate, but the checkbox to approve it, is not activate then we can not open the form....&lt;br /&gt;Can anybody help???&lt;br /&gt;&lt;br /&gt;Thanks in advance! ;)&lt;br /&gt;&lt;br /&gt;Miguel Carvalho&lt;br /&gt;Portugal</description></item><item><title>Re: Close Infopath at OnAfterChange Event</title><link>https://www.infopathdev.com:443/forums/thread/14112.aspx</link><pubDate>Wed, 14 Dec 2005 09:18:57 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:14112</guid><dc:creator>Patrick Halstead</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/14112.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=14112</wfw:commentRss><description>Close is level 3 which would imply Full Trust. Check out the SDK.&lt;br /&gt;&lt;br /&gt;Patrick Halstead [InfoPath MVP]&lt;br /&gt;InfoPathDev</description></item><item><title>Re: Close Infopath at OnAfterChange Event</title><link>https://www.infopathdev.com:443/forums/thread/14111.aspx</link><pubDate>Tue, 13 Dec 2005 20:28:59 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:14111</guid><dc:creator>Matt Faus</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/14111.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=14111</wfw:commentRss><description>That is a little weird.  Your form does not have to be fully trusted to use that function.  I couldn't find much information on google about anyone else having this problem - maybe you could put your close functionality inside of a button and have a user click it?&lt;br /&gt;&lt;br /&gt;---------------&lt;br /&gt;Matt Faus&lt;br /&gt;InfoPath Dev Texas&lt;br /&gt;</description></item><item><title>Re: Close Infopath at OnAfterChange Event</title><link>https://www.infopathdev.com:443/forums/thread/14110.aspx</link><pubDate>Tue, 13 Dec 2005 16:43:25 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:14110</guid><dc:creator>zmike</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/14110.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=14110</wfw:commentRss><description>mmmmmm!!!!&lt;br /&gt;i don't know....&lt;br /&gt;i readed it... &lt;br /&gt;&lt;br /&gt;I do not understand why i use:&lt;br /&gt;Application.XDocuments.Close(0);&lt;br /&gt;5 times in the document, and it works.....&lt;br /&gt;&lt;br /&gt;It only do not work OnAfterChange event...&lt;br /&gt;:(&lt;br /&gt;&lt;br /&gt;And i reealy need that...&lt;br /&gt;&lt;br /&gt;Miguel Carvalho&lt;br /&gt;Portugal</description></item><item><title>Re: Close Infopath at OnAfterChange Event</title><link>https://www.infopathdev.com:443/forums/thread/14109.aspx</link><pubDate>Tue, 13 Dec 2005 15:54:26 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:14109</guid><dc:creator>Coita Thierry</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/14109.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=14109</wfw:commentRss><description>Hi,&lt;br /&gt;&lt;br /&gt;Ok I understand now!&lt;br /&gt;&lt;br /&gt;Your form need to be full trust!&lt;br /&gt;&lt;br /&gt;Read this:&lt;br /&lt;a target="_blank" href=http://msdn.microsoft.com/library/default.asp?url=/library/en-us/ipsdk/html/ipsdkUnderstandingFullyTrustedForms_HV01073332.asp&gt;http://msdn.microsoft.com/library/default.asp?url=/library/en-us/ipsdk/html/ipsdkUnderstandingFullyTrustedForms_HV01073332.asp&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;++&lt;br /&gt;&lt;br /&gt;Thierry</description></item><item><title>Re: Close Infopath at OnAfterChange Event</title><link>https://www.infopathdev.com:443/forums/thread/14108.aspx</link><pubDate>Tue, 13 Dec 2005 15:04:56 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:14108</guid><dc:creator>zmike</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/14108.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=14108</wfw:commentRss><description>Thanks...&lt;br /&gt;But i am not using nothing in Visual Studio... Only using Microsoft Script Editor.... :(&lt;br /&gt;&lt;br /&gt;This is what gives me the "OM call" error&lt;br /&gt;Application.XDocuments.Close(0);&lt;br /&gt;&lt;br /&gt;I try other solutions.... But nothing..&lt;br /&gt;Do I have to create a new project on VS only to solve this situation??!&lt;br /&gt;&lt;br /&gt;Regards,&lt;br /&gt;&lt;br /&gt;Miguel Carvalho&lt;br /&gt;Portugal</description></item><item><title>Re: Close Infopath at OnAfterChange Event</title><link>https://www.infopathdev.com:443/forums/thread/14107.aspx</link><pubDate>Tue, 13 Dec 2005 13:15:55 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:14107</guid><dc:creator>Coita Thierry</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/14107.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=14107</wfw:commentRss><description>Hi,&lt;br /&gt;&lt;br /&gt;Welcome on Infopathdev.com!&lt;br /&gt;&lt;br /&gt;yes you can in C#:&lt;br /&gt;&lt;br /&gt;&lt;pre&gt;thisApplication.XDocuments.Close(0);&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;++&lt;br /&gt;&lt;br /&gt;Thierry</description></item><item><title>Close Infopath at OnAfterChange Event</title><link>https://www.infopathdev.com:443/forums/thread/12711.aspx</link><pubDate>Tue, 13 Dec 2005 11:38:01 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:12711</guid><dc:creator>zmike</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/12711.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=12711</wfw:commentRss><description>Hi,again!!&lt;br /&gt;Is that possible??!!&lt;br /&gt;To Close Infopath at OnAfterChange Event&lt;br /&gt;I get always an error:&lt;br /&gt;Invalid context for OM call.&lt;br /&gt;&lt;br /&gt;I already readed a topic about that....&lt;br /&gt;But i really need to close the infopath on that event....&lt;br /&gt;&lt;br /&gt;Thanks.&lt;br /&gt;&lt;br /&gt;Miguel Carvalho&lt;br /&gt;Portugal</description></item></channel></rss>