<?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: Submit Form To SP Library &amp; Email using VB</title><link>https://www.infopathdev.com:443/forums/thread/84473.aspx</link><pubDate>Fri, 16 Nov 2012 00:05:19 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:84473</guid><dc:creator>Hilary Stoupa</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/84473.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=84473</wfw:commentRss><description>&lt;p&gt;Well - dumb question, but usually I&amp;#39;ve seen this error when my data connection is wrong - i.e., my data connection name is &amp;quot;submit&amp;quot; instead of &amp;quot;Submit&amp;quot; - so, can you verify that &amp;quot;Submit&amp;quot; is actually the name of your submit data connection?&lt;/p&gt;</description></item><item><title>Submit Form To SP Library &amp; Email using VB</title><link>https://www.infopathdev.com:443/forums/thread/84472.aspx</link><pubDate>Thu, 15 Nov 2012 21:56:27 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:84472</guid><dc:creator>Ghoztrider</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/84472.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=84472</wfw:commentRss><description>&lt;p&gt;&amp;nbsp;Hi All,&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;I&amp;#39;m trying to run a bunch of tasks through vb code entirely instead of using rules because of the way infopath 2007 operates (rules first/ code second). It&amp;#39;s was going fairly well until I try to submit through VB code.&amp;nbsp; Below is the code I used that is giving me an error (Copied from:http://social.msdn.microsoft.com/Forums/en-US/sharepointcustomizationlegacy/thread/e79ba632-aa41-4313-9d6d-2dc8ac15af24/):&lt;/p&gt;&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;i&gt; Dim fc As FileSubmitConnection = DirectCast(Me.DataConnections(&amp;quot;Submit&amp;quot;), FileSubmitConnection)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; fc.FolderUrl = &amp;quot;http://YOURSERVER/YOUR-FORM-LIBRARY&amp;quot;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; fc.Execute()&lt;/i&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;Here is the error I&amp;#39;m getting. Does anyone know how to decipher this?&lt;/p&gt;&lt;p&gt;&lt;i&gt;System.Collections.Generic.KeyNotFoundException&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; The given key was not present in the dictionary.&lt;br /&gt;&amp;nbsp;&amp;nbsp; at System.ThrowHelper.ThrowKeyNotFoundException()&lt;br /&gt;&amp;nbsp;&amp;nbsp; at System.Collections.Generic.Dictionary`2.get_Item(TKey key)&lt;br /&gt;&amp;nbsp;&amp;nbsp; at Microsoft.Office.InfoPath.Internal.DataConnectionsHost.get_Item(String name)&lt;br /&gt;&amp;nbsp;&amp;nbsp; at Equipment_Transfer.FormCode.CTRL105_15_Clicked(Object sender, ClickedEventArgs e)&lt;br /&gt;&amp;nbsp;&amp;nbsp; at Microsoft.Office.InfoPath.Internal.ButtonEventHost.OnButtonClick(DocActionEvent pEvent)&lt;br /&gt;&amp;nbsp;&amp;nbsp; at Microsoft.Office.Interop.InfoPath.SemiTrust._ButtonEventSink_SinkHelper.OnClick(DocActionEvent pEvent)&lt;br /&gt;&amp;nbsp;&lt;/i&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;I&amp;#39;ve googled the error messages and it seems way over my head at this point anyway. Ill post code if need be. Basically what I&amp;#39;m trying to do with one button in VB is:&lt;/p&gt;&lt;ol&gt;&lt;li&gt;Set CurrentStat field to &amp;quot;Submitted&amp;quot; (Done)&lt;/li&gt;&lt;li&gt;Populate Edit History group fields (auto insert row into repeating table) with current user data using GetUserProfile connection (Done)&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Clear 4 fields in Current_User group (Done)&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Submit form to SP library (Need Guidance)&lt;/li&gt;&lt;li&gt;Email form to recipients (Need Guidance)&lt;/li&gt;&lt;li&gt;Close Form (Done)&lt;/li&gt;&lt;/ol&gt;&lt;p&gt;I know how to get this working using rules except for step 2 (auto insert new row). &lt;/p&gt;&lt;p&gt;I know how get this working using vb except for step 4 &amp;amp; 5. I&amp;#39;m stuck either way....blahhhhhh. Thanks in advance for any assistance I may get. &lt;br /&gt;&lt;/p&gt;</description></item></channel></rss>