<?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: ERROR on opening form</title><link>https://www.infopathdev.com:443/forums/thread/28438.aspx</link><pubDate>Wed, 30 Apr 2008 19:39:04 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:28438</guid><dc:creator>Greg Collins</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/28438.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=28438</wfw:commentRss><description>&lt;p&gt;That&amp;#39;s great new! I&amp;#39;m glad you got it all working!&lt;/p&gt;</description></item><item><title>Re: ERROR on opening form</title><link>https://www.infopathdev.com:443/forums/thread/28420.aspx</link><pubDate>Wed, 30 Apr 2008 14:34:22 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:28420</guid><dc:creator>barmatt80</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/28420.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=28420</wfw:commentRss><description>&lt;p&gt;I did take the code out of the startup and put it in the load event handler.&amp;nbsp; works flawless now.&lt;/p&gt;</description></item><item><title>Re: ERROR on opening form</title><link>https://www.infopathdev.com:443/forums/thread/28367.aspx</link><pubDate>Mon, 28 Apr 2008 22:17:32 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:28367</guid><dc:creator>Greg Collins</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/28367.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=28367</wfw:commentRss><description>&lt;p&gt;I&amp;#39;m glad to hear you got it working... but seriously, I&amp;#39;d look at getting that code out of the _Startup method if at all possible. It might work now, but cause you future headaches down the road. If you look back at your original error message you see:&lt;/p&gt;
&lt;p class="MsoNormal" style="MARGIN:0in 0in 0pt;"&gt;&lt;span style="FONT-SIZE:10pt;FONT-FAMILY:&amp;#39;Arial&amp;#39;,&amp;#39;sans-serif&amp;#39;;"&gt;System.InvalidOperationException&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="MARGIN:0in 0in 0pt;"&gt;&lt;span style="FONT-SIZE:10pt;FONT-FAMILY:&amp;#39;Arial&amp;#39;,&amp;#39;sans-serif&amp;#39;;"&gt;&lt;strong&gt;&lt;u&gt;The _Startup or _Shutdown method in this form&amp;#39;s code contains one or more calls to members of the Microsoft.Office.Interop.InfoPath.SemiTrust namespace. Calls to this namespace from these methods are not permitted.&lt;/u&gt;&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;</description></item><item><title>Re: ERROR on opening form</title><link>https://www.infopathdev.com:443/forums/thread/28299.aspx</link><pubDate>Fri, 25 Apr 2008 17:42:43 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:28299</guid><dc:creator>barmatt80</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/28299.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=28299</wfw:commentRss><description>&lt;p&gt;the problem was service pack 1 on ms office 2007.&amp;nbsp; I uninstalled, reinstalled office 2007, reinstalled with on service pack, republished the forms and all is well now.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;thanks for the help.&lt;/p&gt;</description></item><item><title>Re: ERROR on opening form</title><link>https://www.infopathdev.com:443/forums/thread/28283.aspx</link><pubDate>Fri, 25 Apr 2008 13:13:22 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:28283</guid><dc:creator>barmatt80</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/28283.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=28283</wfw:commentRss><description>&lt;p&gt;As a side note, the code works the same in the startup and load events.&amp;nbsp; The reason I initially put the code in the startup was because I had it pull the username and then query sql database on load.&amp;nbsp; If i put the code in the onload it would not work, the query would return no values, but moving it to the startup it worked.&lt;/p&gt;
&lt;p&gt;But I have narrowed it down to possibly being service pack 1 on office 2007. Based off this: &lt;a href="http://www.infopathdev.com/forums/t/7683.aspx"&gt;http://www.infopathdev.com/forums/t/7683.aspx&lt;/a&gt;&amp;nbsp; so I am going to have office 2007 installed without the service pack and go from there.&amp;nbsp; Hopefully I can get that done today, but I will report back with success or failures.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;The form is not browser based, it is published to MOSS 2007.&lt;/p&gt;</description></item><item><title>Re: ERROR on opening form</title><link>https://www.infopathdev.com:443/forums/thread/28261.aspx</link><pubDate>Thu, 24 Apr 2008 23:34:04 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:28261</guid><dc:creator>Greg Collins</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/28261.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=28261</wfw:commentRss><description>&lt;p&gt;All the code that you showed before that you added to the _Startup method should be moved to the Loading method. It doesn&amp;#39;t belong in _Startup. Do some reasearch into the Help system on the _Startup method and you will see why.&lt;/p&gt;
&lt;p&gt;As for the form not working on IP03: Is this a browser form? If so, then there shouldn&amp;#39;t be an issue because in that case you don&amp;#39;t even need InfoPath. If it is not a browser form, I&amp;#39;m not sure at this stage what is wrong. What kind of errors are you getting now?&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item><item><title>Re: ERROR on opening form</title><link>https://www.infopathdev.com:443/forums/thread/28223.aspx</link><pubDate>Thu, 24 Apr 2008 15:41:21 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:28223</guid><dc:creator>barmatt80</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/28223.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=28223</wfw:commentRss><description>&lt;p&gt;service pack 2 is installed on office 2003&lt;/p&gt;</description></item><item><title>Re: ERROR on opening form</title><link>https://www.infopathdev.com:443/forums/thread/28216.aspx</link><pubDate>Thu, 24 Apr 2008 13:18:10 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:28216</guid><dc:creator>barmatt80</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/28216.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=28216</wfw:commentRss><description>&lt;p&gt;Thanks for the help, I did get the code to work.&amp;nbsp; I had two try catch statements, I deleted one and rewrote the first one, and&amp;nbsp;left it in the startup.&amp;nbsp; My problem now is that it is not working on some pc&amp;#39;s.&amp;nbsp; I mirrored internet explorer settings on a machine that was working, to one that was not working and that pc still isn&amp;#39;t working.&amp;nbsp; All pc&amp;#39;s have .net 2.0.&amp;nbsp; The only difference I can see now between the working and non working pc&amp;#39;s are that the working pc is using Infopath 2007 and the non working computer is using infopath 2003.&amp;nbsp; I don&amp;#39;t think this would cause the issue because Infopath says no problem in the compatibility checker.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;The problem is as if you add the sharepoint site to the trusted sites, and then the code just doesn&amp;#39;t work.&lt;/p&gt;
&lt;p&gt;Greg, so&amp;nbsp;do you think&amp;nbsp;moving the code from _onStartup to _onLoad fix this?&lt;/p&gt;</description></item><item><title>Re: ERROR on opening form</title><link>https://www.infopathdev.com:443/forums/thread/28191.aspx</link><pubDate>Wed, 23 Apr 2008 16:46:51 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:28191</guid><dc:creator>Greg Collins</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/28191.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=28191</wfw:commentRss><description>&lt;p&gt;You are confusing the _Startup method with the OnLoad method. They are not the same. You cannot write InfoPath code in the _Startup method. Please add the OnLoad event handler and move your code into there.&lt;/p&gt;</description></item><item><title>ERROR on opening form</title><link>https://www.infopathdev.com:443/forums/thread/28141.aspx</link><pubDate>Tue, 22 Apr 2008 15:38:04 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:28141</guid><dc:creator>barmatt80</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/28141.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=28141</wfw:commentRss><description>&lt;p&gt;This is my error:&lt;/p&gt;
&lt;p class="MsoNormal" style="MARGIN:0in 0in 0pt;"&gt;&lt;span style="FONT-SIZE:10pt;FONT-FAMILY:&amp;#39;Arial&amp;#39;,&amp;#39;sans-serif&amp;#39;;"&gt;System.InvalidOperationException&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="MARGIN:0in 0in 0pt;"&gt;&lt;span style="FONT-SIZE:10pt;FONT-FAMILY:&amp;#39;Arial&amp;#39;,&amp;#39;sans-serif&amp;#39;;"&gt;The _Startup or _Shutdown method in this form&amp;#39;s code contains one or more calls to members of the Microsoft.Office.Interop.InfoPath.SemiTrust namespace. Calls to this namespace from these methods are not permitted.&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="MARGIN:0in 0in 0pt;"&gt;&lt;span style="FONT-SIZE:10pt;FONT-FAMILY:&amp;#39;Arial&amp;#39;,&amp;#39;sans-serif&amp;#39;;"&gt;&amp;nbsp;&amp;nbsp; at System.RuntimeMethodHandle._InvokeMethodFast(Object target, Object[] arguments, SignatureStruct&amp;amp; sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="MARGIN:0in 0in 0pt;"&gt;&lt;span style="FONT-SIZE:10pt;FONT-FAMILY:&amp;#39;Arial&amp;#39;,&amp;#39;sans-serif&amp;#39;;"&gt;&amp;nbsp;&amp;nbsp; at System.RuntimeMethodHandle.InvokeMethodFast(Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="MARGIN:0in 0in 0pt;"&gt;&lt;span style="FONT-SIZE:10pt;FONT-FAMILY:&amp;#39;Arial&amp;#39;,&amp;#39;sans-serif&amp;#39;;"&gt;&amp;nbsp;&amp;nbsp; at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="MARGIN:0in 0in 0pt;"&gt;&lt;span style="FONT-SIZE:10pt;FONT-FAMILY:&amp;#39;Arial&amp;#39;,&amp;#39;sans-serif&amp;#39;;"&gt;&amp;nbsp;&amp;nbsp; at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="MARGIN:0in 0in 0pt;"&gt;&lt;span style="FONT-SIZE:10pt;FONT-FAMILY:&amp;#39;Arial&amp;#39;,&amp;#39;sans-serif&amp;#39;;"&gt;&amp;nbsp;&amp;nbsp; at System.RuntimeType.InvokeMember(String name, BindingFlags bindingFlags, Binder binder, Object target, Object[] providedArgs, ParameterModifier[] modifiers, CultureInfo culture, String[] namedParams)&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="MARGIN:0in 0in 0pt;"&gt;&lt;span style="FONT-SIZE:10pt;FONT-FAMILY:&amp;#39;Arial&amp;#39;,&amp;#39;sans-serif&amp;#39;;"&gt;&amp;nbsp;&amp;nbsp; at System.Type.InvokeMember(String name, BindingFlags invokeAttr, Binder binder, Object target, Object[] args, CultureInfo culture)&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="MARGIN:0in 0in 0pt;"&gt;&lt;span style="FONT-SIZE:10pt;FONT-FAMILY:&amp;#39;Arial&amp;#39;,&amp;#39;sans-serif&amp;#39;;"&gt;&amp;nbsp;&amp;nbsp; at Microsoft.Office.Interop.InfoPath.SemiTrust.InfoPathOMHelper.Run(String assemblyFullPathName)&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="MARGIN:0in 0in 0pt;"&gt;&lt;span style="FONT-SIZE:10pt;FONT-FAMILY:&amp;#39;Arial&amp;#39;,&amp;#39;sans-serif&amp;#39;;"&gt;&lt;/span&gt;&amp;nbsp;&lt;/p&gt;
&lt;p class="MsoNormal" style="MARGIN:0in 0in 0pt;"&gt;&lt;span style="FONT-SIZE:10pt;FONT-FAMILY:&amp;#39;Arial&amp;#39;,&amp;#39;sans-serif&amp;#39;;"&gt;and this is the code I think that is causing the problem:&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal" style="MARGIN:0in 0in 0pt;"&gt;&lt;span style="FONT-SIZE:10pt;FONT-FAMILY:&amp;#39;Arial&amp;#39;,&amp;#39;sans-serif&amp;#39;;"&gt;&lt;/span&gt;&amp;nbsp;&lt;/p&gt;&lt;span style="FONT-SIZE:10pt;FONT-FAMILY:&amp;#39;Arial&amp;#39;,&amp;#39;sans-serif&amp;#39;;"&gt;&lt;font color="#0000ff" size="2"&gt;Public&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;Sub&lt;/font&gt;&lt;font size="2"&gt; _Startup(&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;ByVal&lt;/font&gt;&lt;font size="2"&gt; app &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;As&lt;/font&gt;&lt;font size="2"&gt; Application, &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;ByVal&lt;/font&gt;&lt;font size="2"&gt; doc &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;As&lt;/font&gt;&lt;font size="2"&gt; XDocument)&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; 
&lt;p&gt;thisXDocument = doc&lt;/p&gt;
&lt;p&gt;thisApplication = app&lt;/p&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;
&lt;p&gt;&lt;/font&gt;&lt;font size="2"&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;If&lt;/font&gt;&lt;font size="2"&gt; thisXDocument.DOM.selectSingleNode(&lt;/font&gt;&lt;font color="#a31515" size="2"&gt;&amp;quot;/dfs:myFields/my:ApprovalSignatures/my:EmployeeSign&amp;quot;&lt;/font&gt;&lt;font size="2"&gt;).text &amp;lt;&amp;gt; &lt;/font&gt;&lt;font color="#a31515" size="2"&gt;&amp;quot;&amp;quot;&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;Then&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font color="#0000ff" size="2"&gt;Try&lt;/p&gt;&lt;/font&gt;&lt;font size="2"&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;Dim&lt;/font&gt;&lt;font size="2"&gt; strCurrentUser &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;As&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;String&lt;/font&gt;&lt;font size="2"&gt; = System.Environment.UserName&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; 
&lt;p&gt;thisXDocument.DOM.selectSingleNode(&lt;/font&gt;&lt;font color="#a31515" size="2"&gt;&amp;quot;/dfs:myFields/my:Misc/my:CurrentUser&amp;quot;&lt;/font&gt;&lt;font size="2"&gt;).text = strCurrentUser&lt;/p&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;Catch&lt;/font&gt;&lt;font size="2"&gt; ex &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;As&lt;/font&gt;&lt;font size="2"&gt; Exception&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; 
&lt;p&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;End&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;Try&lt;/p&gt;&lt;/font&gt;&lt;font size="2"&gt;
&lt;p&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;End&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;If&lt;/p&gt;&lt;/font&gt;&lt;font size="2"&gt;
&lt;p&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;End&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;Sub&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font color="#0000ff" size="2"&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&amp;nbsp;&lt;/p&gt;&lt;/font&gt;&lt;/span&gt;
&lt;p&gt;The code works fine on my pc, I am using infopath 2007(coding vb.net backward compatible infopath 2003), I have the latest updates, IE 7, running MOSS 2007.&lt;/p&gt;
&lt;p&gt;The pc&amp;#39;s that are having the issue are using InfoPath 2003, IE 6.&amp;nbsp; The pc&amp;#39;s have .net framework 2.0 installed and office 2003 primary interop assemblies installed. &lt;/p&gt;
&lt;p&gt;Any suggestions or missing items that need to be installed?&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item></channel></rss>