<?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>Newbie Questions</title><link>https://www.infopathdev.com:443/forums/39.aspx</link><description>New to InfoPath? Search to see if your question has already been answered. If it has not, then ask it here or the appropriate topic forum.</description><dc:language>en</dc:language><generator>CommunityServer 2007 SP3 (Build: 31118.962)</generator><item><title>Re: Persistent InfoPath error</title><link>https://www.infopathdev.com:443/forums/thread/25935.aspx</link><pubDate>Fri, 25 Jan 2008 20:54:36 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:25935</guid><dc:creator>srudolph728</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/25935.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=25935</wfw:commentRss><description>&lt;p&gt;Hehe - leave it to me to unwittingly create and release a rogue application on my
own computer! But what you describe is exactly what&amp;#39;s happening. I&amp;#39;ll go ahead and post the code here in case it&amp;#39;s helpful. I didn&amp;#39;t write it myself, it&amp;#39;s converted over to .NET from a VB script my department manager found on the web. It&amp;#39;s in the codebehind of a Windows form because the idea was to have an .exe that can be called and executed as a scheduled task.&lt;/p&gt;&lt;blockquote&gt;&lt;p&gt;Public Class Form1&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Private moApp As Microsoft.Office.Interop.InfoPath.Application&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Private moXDoc As Microsoft.Office.Interop.InfoPath.XDocument&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; NewNPQTEST()&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Me.Close()&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; End Sub&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Private Sub NewNPQTEST()&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim i As Integer, j As Integer&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; On Error GoTo MyError&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;#39;Open your custom template in presentation view.&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; moApp = New Microsoft.Office.Interop.InfoPath.Application&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; moXDoc = moApp.XDocuments.NewFromSolution(&amp;quot;http://[server]/IT/requests/NPQTEST/Forms/template.xsn&amp;quot;)&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Do While i &amp;lt; moXDoc.DOM.childNodes.length&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Do While j &amp;lt; moXDoc.DOM.childNodes.item(i).childNodes.length&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Debug.Print(moXDoc.DOM.childNodes.item(i).childNodes.item(j).nodeName)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; With moXDoc.DOM.childNodes.item(i).childNodes.item(j)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Select Case .nodeName&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Case &amp;quot;my:TestField1&amp;quot;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; .text = &amp;quot;testing&amp;quot;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Case Else&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; End Select&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; End With&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; j = j + 1&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Loop&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; i = i + 1&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Loop&lt;/p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; moXDoc.Submit()&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; If moApp.XDocuments.Count &amp;gt; 0 Then&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; For i = moApp.XDocuments.Count - 1 To 0 Step -1&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; moApp.XDocuments.Close(i)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Next&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; End If&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; moApp.Quit()&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; moApp = Nothing&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Exit Sub&lt;br /&gt;&lt;br /&gt;MyError:&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MsgBox(Err.Number &amp;amp; &amp;quot; - &amp;quot; &amp;amp; Err.Description, vbOKOnly + vbExclamation, &amp;quot;error in NewNPQTEST&amp;quot;)&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; End Sub&lt;br /&gt;End Class&lt;br /&gt;&lt;/blockquote&gt;</description></item><item><title>Re: Persistent InfoPath error</title><link>https://www.infopathdev.com:443/forums/thread/25929.aspx</link><pubDate>Fri, 25 Jan 2008 20:20:30 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:25929</guid><dc:creator>Patrick Halstead</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/25929.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=25929</wfw:commentRss><description>&lt;p&gt;Hi Srudolph728,&lt;/p&gt;
&lt;p&gt;This is very interesting. I have never heard of anyone writing a default script for all InfoPath forms. I didn&amp;#39;t even know it was possible. Usually, the script runs as part of an XSN not as part of InfoPath executable. So what you are saying is: if you just go to Windows-&amp;gt;Start and choose InfoPath, it flashes the Getting Started screen and then goes away. You didn&amp;#39;t specify a form and&amp;nbsp;yet it creates a new record in SharePoint!? To be honest, I can&amp;#39;t imagine how this would happen. Unless you are infected with some rogue&amp;nbsp;application or something, there should be no way of having a script run for all InfoPath forms. That&amp;#39;s just impossible. &lt;/p&gt;</description></item><item><title>Re: Persistent InfoPath error</title><link>https://www.infopathdev.com:443/forums/thread/25921.aspx</link><pubDate>Fri, 25 Jan 2008 15:15:08 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:25921</guid><dc:creator>srudolph728</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/25921.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=25921</wfw:commentRss><description>&lt;p&gt;Hi Patrick - I did run both Microsoft Office Diagnostics and the Office repair utility a few days ago but to no avail. Just for fun, I ran them both again this morning and the issue is still there; however, the diagnostic was incomplete because it was missing a file - I&amp;#39;ll try it again once it gets downloaded. The script is written to create a new document in a specific Sharepoint site, and I believe that the script is indeed running when I try to open base InfoPath through the Start menu because after the app opens and I see the Getting Started screen for a second before it closes down, I check the Sharepoint site and there is a new document with that exact date and time. It really seems as if the script that I wrote has somehow become embedded in InfoPath so that any time I try to open a form or run any other script it executes. I don&amp;#39;t know if that&amp;#39;s even possible but I&amp;#39;m sure it&amp;#39;s being executed because I can see the results. Oddly, the only time it doesn&amp;#39;t generate a new document is when I open an existing InfoPath document in Sharepoint, though I do get the error messagebox I mentioned in my first post. Thanks.&lt;br /&gt;&lt;/p&gt;</description></item><item><title>Re: Persistent InfoPath error</title><link>https://www.infopathdev.com:443/forums/thread/25914.aspx</link><pubDate>Fri, 25 Jan 2008 03:53:18 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:25914</guid><dc:creator>Patrick Halstead</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/25914.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=25914</wfw:commentRss><description>&lt;p&gt;If you are seeing Getting Started screen, it wouldn&amp;#39;t be failing because of script. You only see the Getting Started when you are opening InfoPath without a form template. Script only executes in form templates. Hence, this is probably just a bad install. Have you tried repairing Office?&lt;/p&gt;</description></item><item><title>Re: Persistent InfoPath error</title><link>https://www.infopathdev.com:443/forums/thread/25907.aspx</link><pubDate>Thu, 24 Jan 2008 18:06:51 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:25907</guid><dc:creator>srudolph728</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/25907.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=25907</wfw:commentRss><description>&lt;p&gt;I was thinking that as well, but when I go to Start - Programs -&amp;nbsp; Microsoft Office - Infopath, the &amp;#39;getting started&amp;#39; screen opens but then the app immediately closes. I think this is because my script is being executed and has a me.close statement in it (I know the script is being executed because a new document is being created).&lt;/p&gt;&lt;p&gt;I&amp;#39;m considering completely uninstalling Office out of desperation, but I&amp;#39;m not even sure that will fix the problem. Is there any other way to clear the cache?&lt;/p&gt;</description></item><item><title>Re: Persistent InfoPath error</title><link>https://www.infopathdev.com:443/forums/thread/25906.aspx</link><pubDate>Thu, 24 Jan 2008 17:51:38 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:25906</guid><dc:creator>Greg Collins</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/25906.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=25906</wfw:commentRss><description>&lt;p&gt;Strange indeed. Have you tried clearing your cache? It could be that a cached version of the form is being loaded instead of the new one.&lt;/p&gt;</description></item><item><title>Re: Persistent InfoPath error</title><link>https://www.infopathdev.com:443/forums/thread/25853.aspx</link><pubDate>Wed, 23 Jan 2008 15:30:42 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:25853</guid><dc:creator>srudolph728</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/25853.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=25853</wfw:commentRss><description>&lt;p&gt;Hi Greg - other than the error, I think the major issue I&amp;#39;m having is that every time I try to execute code using InfoPath, an older version of this script gets executed instead.&lt;/p&gt;&lt;p&gt;&amp;nbsp;For example: I originally had this script (call it Script1), which autofilled a text field on a test form with data, let&amp;#39;s say &amp;quot;TestText1&amp;quot; in a Sharepoint document library page (Page1). Now, I change the data to &amp;quot;TestText2&amp;quot; and rerun Script1, but it creates a new document with &amp;quot;TestText1&amp;quot; in the field. I comment out the line of code that creates the document, rerun it, and it does the exact same thing, creating a new document with &amp;quot;TextText1&amp;quot; in the form field.&lt;/p&gt;&lt;p&gt;So, I create a new project (Script2) with the same code but pointing to a completely different document library section of Sharepoint (Page2) using &amp;quot;TestText2&amp;quot; as test data. When I run Script2, I end up with a new document on Page1 with TestText1 in the form, and no document gets created on Page2 at all. So, it would seem that some earlier version of Script1 is somehow getting executed from within InfoPath whenever I execute any script at all from Visual Studio, regardless of any changes I&amp;#39;ve made. I just can&amp;#39;t figure out how to stop this from happening; it seems to be localized to my machine.&lt;br /&gt;&lt;/p&gt;</description></item><item><title>Re: Persistent InfoPath error</title><link>https://www.infopathdev.com:443/forums/thread/25842.aspx</link><pubDate>Tue, 22 Jan 2008 22:52:04 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:25842</guid><dc:creator>Greg Collins</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/25842.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=25842</wfw:commentRss><description>&lt;p&gt;Seems to me like a legitimate error message. Have yo utried walking through your code with a debugger? Sounds like you are doing something (probably in the OnLoad / Loading event) which is illegal during that event.&lt;/p&gt;</description></item><item><title>Persistent InfoPath error</title><link>https://www.infopathdev.com:443/forums/thread/25835.aspx</link><pubDate>Tue, 22 Jan 2008 19:13:31 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:25835</guid><dc:creator>srudolph728</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/25835.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=25835</wfw:commentRss><description>&lt;p&gt;Hi all, I&amp;#39;m hoping someone can help with this. I was tasked with creating a way to automatically generate InfoPath documents on the fly, to be stored on a Sharepoint website. I found some code on the web and managed to get it to work correctly as a VB app, but I get the following error message when I run the script (output by the code in a messagebox): &amp;quot;Invalid context for OM call. InfoPath cannot execute any load calls while another load call is in progress&amp;quot;. The problem is that I can&amp;#39;t get rid of this error&amp;nbsp; - it pops up when I open any InfoPath document, even on another part of the site. I tried rebooting, removing the VB project from my machine, running the Office repair utility, and even uninstalling and reinstalling InfoPath, all to no avail. The worst part is that I created a new project with the same code but pointing to a different Sharepoint page, and when I run that code, the old code executes instead. It seems pretty clear that the code is still being executed somehow, but I can&amp;#39;t figure out how to get rid of it. Does anyone have any suggestions as to what I can do to stop this code from running? Please let me know if I need to post any more information.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;Thanks,&lt;/p&gt;&lt;p&gt;Steve&lt;br /&gt;&amp;nbsp;&lt;/p&gt;</description></item></channel></rss>