<?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: Perform a button click through code</title><link>https://www.infopathdev.com:443/forums/thread/80084.aspx</link><pubDate>Mon, 02 Jul 2012 15:27:08 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:80084</guid><dc:creator>Doreen</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/80084.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=80084</wfw:commentRss><description>&lt;p&gt;Jimmy, &lt;/p&gt;&lt;p&gt;Thank you. I actually applied your second alternative on my own&amp;nbsp;prior to the recent &amp;quot;commentary&amp;quot; in this forum. Only I used &lt;strong&gt;FormEvents_Submit()&lt;/strong&gt; instead of &lt;strong&gt;SubmitAction(&lt;/strong&gt;) (hmmm?).&amp;nbsp;It&amp;nbsp;worked well with one exception - the form did not close once it was submitted.&amp;nbsp; To remedy that, I put Application.Quit () method&amp;nbsp;in button click event after &lt;strong&gt;FormEvents_Submit()&lt;/strong&gt;method (Note: Microsoft says you cannot put Application.Quit() method in the &lt;strong&gt;FormEvents_Submit()&lt;/strong&gt; method).&lt;/p&gt;&lt;p&gt;&lt;br /&gt;Application.Quit () method never ran&amp;nbsp; because of an error (not verbatim): &amp;quot;method does not use zero parameters&amp;quot; .&amp;nbsp;It needed values for the missing parameters; &amp;#39;sender&amp;#39; and &amp;#39;e&amp;#39; but I didn&amp;#39;t know what those values should be.&amp;nbsp;&amp;nbsp; I had added the &lt;strong&gt;FormEvents_Submit()&lt;/strong&gt;method manually without those pararmeters.&amp;nbsp; When I&amp;nbsp;added the &lt;strong&gt;FormEvents_Submit() &lt;/strong&gt;method properly; from InfoPath &lt;strong&gt;Tools&lt;/strong&gt; menu, choose&amp;nbsp;&lt;strong&gt;submit options&lt;/strong&gt; and checked &amp;quot;&lt;strong&gt;Perform custom action using c&lt;/strong&gt;ode&amp;quot; &amp;nbsp;which in turn adds InfoPath generated code to the InternalStartup&amp;nbsp;method and thus gives it two parameters,&amp;nbsp; through debugging&amp;nbsp;found code issued print then submit but then jump back to button click at &lt;strong&gt;FormEvents_Submit() &lt;/strong&gt;break point then reopen the form (and never hit the Application.Quit() method which was last.&amp;nbsp; &lt;/p&gt;&lt;p&gt;It got too&amp;nbsp;time-consuming to troubleshoot&amp;nbsp;so ultimately I ended up with two buttons; a 1) print buttons with code behind and no rules, and a 2) submit button with rules only and no code behind.&amp;nbsp;Now that I&amp;#39;ve explained all this, I feel&amp;nbsp; need to try this with the &lt;strong&gt;SubmitAction()&lt;/strong&gt; you method you recommended to see if it behaves differently, hmm again?&lt;/p&gt;&lt;p&gt;&amp;nbsp;&amp;nbsp;&lt;/p&gt;</description></item><item><title>Re: Perform a button click through code</title><link>https://www.infopathdev.com:443/forums/thread/80066.aspx</link><pubDate>Sun, 01 Jul 2012 15:56:12 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:80066</guid><dc:creator>Jimmy</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/80066.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=80066</wfw:commentRss><description>&lt;p&gt;&lt;BLOCKQUOTE&gt;&lt;div&gt;&lt;img src="/Themes/infopathdev/images/icon-quote.gif"&gt; &lt;strong&gt;My Self The Enemy:&lt;/strong&gt;&lt;/div&gt;&lt;div&gt;as well as it does not explicitly refer to any specific method, &lt;span style="text-align:left;text-transform:none;text-indent:0px;letter-spacing:normal;word-spacing:0px;float:none;white-space:normal;orphans:2;widows:2;font-size-adjust:none;font-stretch:normal;"&gt;be it &lt;b&gt;&lt;span class="Apple-converted-space"&gt;&lt;/span&gt;InternalStartup&lt;/b&gt; or another&lt;/span&gt; .&lt;/div&gt;&lt;/BLOCKQUOTE&gt;&lt;/p&gt;&lt;p&gt;The comment is directly above the InternalStartup() method, so yes, it is referring to InternalStartup(), even if it doesn&amp;#39;t mention it by name.&lt;/p&gt;&lt;p&gt;&lt;BLOCKQUOTE&gt;&lt;div&gt;&amp;quot;Following procedure&amp;quot; is really all methods below (=&amp;quot;following&amp;quot;) these comments&lt;/div&gt;&lt;/BLOCKQUOTE&gt;&lt;/p&gt;&lt;p&gt;No, that&amp;#39;s incorrect.&amp;nbsp; Since &lt;strong&gt;procedure&lt;/strong&gt; is singular, &amp;quot;following procedure&amp;quot; can only mean &amp;quot;the procedure right after this.&amp;quot;&lt;/p&gt;&lt;p&gt;&lt;BLOCKQUOTE&gt;&lt;div&gt;In Infopath the mortal developer is not only unable to tamper but even see the code which is essential for editing but nevertheless is kept hidden and locked from manual (custom) coding/development.&lt;/div&gt;&lt;/BLOCKQUOTE&gt;&lt;/p&gt;&lt;p&gt;I don&amp;#39;t know what this is supposed to mean.&lt;/p&gt;</description></item><item><title>Re: Perform a button click through code</title><link>https://www.infopathdev.com:443/forums/thread/80062.aspx</link><pubDate>Sun, 01 Jul 2012 08:20:02 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:80062</guid><dc:creator>Gennady Vanin (Геннадий Ванин, Новосибирск)</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/80062.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=80062</wfw:commentRss><description>&lt;p&gt;&lt;BLOCKQUOTE&gt;&lt;div&gt;&lt;img src="/Themes/infopathdev/images/icon-quote.gif"&gt; &lt;strong&gt;Jimmy:&lt;/strong&gt;&lt;/div&gt;&lt;div&gt;Causing changes to happen in InternalStartup() via the InfoPath interface, and manually editing the method are two different things.&amp;nbsp; Directly above the method, there&amp;#39;s this auto-generated comment:&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;font color="#008000" size="2"&gt;&lt;font color="#008000" size="2"&gt;// NOTE: The following procedure is required by Microsoft InfoPath.&lt;br /&gt;&lt;/font&gt;&lt;/font&gt;&lt;font color="#008000" size="2"&gt;&lt;font color="#008000" size="2"&gt;// It can be modified using Microsoft InfoPath.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;&lt;p&gt;Now, it doesn&amp;#39;t explicitly say anything about not manually editing it&lt;/div&gt;&lt;/BLOCKQUOTE&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;as well as it does not explicitly refer to any specific method, &lt;span style="text-align:left;text-transform:none;text-indent:0px;letter-spacing:normal;word-spacing:0px;float:none;white-space:normal;orphans:2;widows:2;font-size-adjust:none;font-stretch:normal;"&gt;be it &lt;b&gt;&lt;span class="Apple-converted-space"&gt;&lt;/span&gt;InternalStartup&lt;/b&gt; or another&lt;/span&gt; .&lt;/p&gt;&lt;p&gt;&amp;quot;Following procedure&amp;quot; is really all methods below (=&amp;quot;following&amp;quot;) these comments&lt;/p&gt;&lt;p&gt;I would have believed your opinion if that&amp;nbsp; InfoPath interface not only inserted but also cleaned the code after itself.&lt;br /&gt;For example, if to delete 2nd or 3d button for which a code was generated by &lt;b style="font-family:Verdana;font-size:12px;font-style:normal;font-variant:normal;letter-spacing:normal;line-height:normal;orphans:2;text-align:left;text-indent:0px;text-transform:none;white-space:normal;widows:2;word-spacing:0px;"&gt;clicking &amp;quot;Edit Form Code...&amp;quot;&lt;/b&gt;&lt;span style="font-family:Verdana;font-size:12px;font-style:normal;font-variant:normal;letter-spacing:normal;line-height:normal;orphans:2;text-align:left;text-indent:0px;text-transform:none;white-space:normal;widows:2;word-spacing:0px;"&gt; in their button&amp;#39;s props&lt;/span&gt;&lt;span style="font-family:Verdana;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;orphans:2;text-align:left;text-indent:0px;text-transform:none;white-space:normal;widows:2;word-spacing:0px;float:none;"&gt;&lt;span class="Apple-converted-space"&gt; &lt;/span&gt;&lt;/span&gt;such code is not removed and there is no way to clean it except manually.&lt;/p&gt;&lt;p&gt;In Infopath the mortal developer is not only unable to tamper but even see the code which is essential for editing but nevertheless is kept hidden and locked from manual (custom) coding/development.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item><item><title>Re: Perform a button click through code</title><link>https://www.infopathdev.com:443/forums/thread/80040.aspx</link><pubDate>Sat, 30 Jun 2012 02:55:30 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:80040</guid><dc:creator>Jimmy</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/80040.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=80040</wfw:commentRss><description>&lt;BLOCKQUOTE&gt;&lt;div&gt;&lt;img src="/Themes/infopathdev/images/icon-quote.gif"&gt; &lt;strong&gt;My Self The Enemy:&lt;/strong&gt;&lt;/div&gt;&lt;div&gt;&amp;quot;Tampering&amp;quot; sounds to me synonymous to &amp;quot;cracking&amp;quot;.&lt;br /&gt;Isn&amp;#39;t user tampering when he presses &amp;quot;Edit Form Code...&amp;quot; button inserting:&lt;blockquote&gt;&lt;p&gt;&lt;span style="text-transform:none;text-indent:0px;letter-spacing:normal;word-spacing:0px;float:none;white-space:normal;orphans:2;widows:2;font-size-adjust:none;font-stretch:normal;-webkit-text-size-adjust:auto;-webkit-text-stroke-width:0px;"&gt;((ButtonEvent)EventManager.ControlEvents[&amp;quot;CTRL2_5&amp;quot;]).Clicked += new ClickedEventHandler(CTRL2_5_Clicked);&lt;/span&gt; &lt;br /&gt;&lt;/p&gt;&lt;/blockquote&gt;&lt;p&gt;&amp;nbsp;into&amp;nbsp; &lt;span style="text-align:left;text-transform:none;text-indent:0px;letter-spacing:normal;word-spacing:0px;float:none;white-space:normal;orphans:2;widows:2;font-size-adjust:none;font-stretch:normal;"&gt;&lt;span class="Apple-converted-space"&gt;&lt;/span&gt;InternalStartup method?&lt;/span&gt;&lt;/div&gt;&lt;/BLOCKQUOTE&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;Causing changes to happen in InternalStartup() via the InfoPath interface, and manually editing the method are two different things.&amp;nbsp; Directly above the method, there&amp;#39;s this auto-generated comment:&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;font color="#008000" size="2"&gt;&lt;font color="#008000" size="2"&gt;// NOTE: The following procedure is required by Microsoft InfoPath.&lt;br /&gt;&lt;/font&gt;&lt;/font&gt;&lt;font color="#008000" size="2"&gt;&lt;font color="#008000" size="2"&gt;// It can be modified using Microsoft InfoPath.&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;&lt;p&gt;Now, it doesn&amp;#39;t explicitly say anything about not manually editing it, but I would interperet that as a warning against manually editing it, and if there&amp;#39;s a simple alternative, I would use the alternative.&lt;/p&gt;&lt;p&gt;Doreen, have you found a solution yet to your issue?&amp;nbsp; There isn&amp;#39;t a way to invoke a button&amp;#39;s rules from code, but I can think of two alternatives:&lt;/p&gt;&lt;p&gt;&amp;nbsp;First alternative:&lt;/p&gt;&lt;ol&gt;&lt;li&gt;Create a secondary XML file data connection with a field called &lt;strong&gt;Print&lt;/strong&gt;.&amp;nbsp; Add an OnChanged handler to that Print field, and have that event handler print the form.&lt;/li&gt;&lt;li&gt;Change your print button so its rules are like this:&lt;br /&gt;Set &lt;strong&gt;Print&lt;/strong&gt; field to &amp;quot;go&amp;quot;&lt;br /&gt;(Then duplicate all of the rules from the Submit button)&lt;/li&gt;&lt;/ol&gt;&lt;p&gt;Second alternative:&lt;/p&gt;&lt;ol&gt;&lt;li&gt;Create a method in your code called SubmitAction() that does all of the same stuff as your Submit button, but in code instead of rules.&lt;/li&gt;&lt;li&gt;Add an event handler to your Submit button, and have it call SubmitAction()&lt;/li&gt;&lt;li&gt;Modify your Print button&amp;#39;s event handler to call SubmitAction() after it does the printing.&lt;/li&gt;&lt;/ol&gt;&lt;p&gt;I believe that those will work, but please give them a try.&lt;/p&gt;&lt;font color="#008000" size="2"&gt;&lt;font color="#008000" size="2"&gt;&lt;/font&gt;&lt;/font&gt;</description></item><item><title>Re: Perform a button click through code</title><link>https://www.infopathdev.com:443/forums/thread/80035.aspx</link><pubDate>Fri, 29 Jun 2012 21:06:50 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:80035</guid><dc:creator>Gennady Vanin (Геннадий Ванин, Новосибирск)</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/80035.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=80035</wfw:commentRss><description>&lt;p&gt;&lt;BLOCKQUOTE&gt;&lt;div&gt;&lt;img src="/Themes/infopathdev/images/icon-quote.gif"&gt; &lt;strong&gt;Doreen:&lt;/strong&gt;&lt;/div&gt;&lt;div&gt;Gennady Vanin&lt;b&gt;,&lt;/b&gt;&lt;/p&gt;&lt;p&gt;Yes I am using InfoPath 2007&lt;/div&gt;&lt;/BLOCKQUOTE&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;I am using 2010 but &amp;quot;code behind&amp;quot; in IPD2010 is created by antiquated Visual Studio 2005 Tools for Applications with .NET 2.0 &lt;br /&gt;So, my guess is that manual and oral &amp;quot;coding&amp;quot; in IP2010 should not differ much &amp;nbsp; &lt;/p&gt;&lt;p&gt;&lt;BLOCKQUOTE&gt;&lt;div&gt;&lt;img src="/Themes/infopathdev/images/icon-quote.gif"&gt; &lt;strong&gt;Doreen:&lt;/strong&gt;&lt;/div&gt;&lt;div&gt; and my question is: I want to know how to fire off a 2nd button programmatically when user clicks the 1st button&lt;/div&gt;&lt;/BLOCKQUOTE&gt;&lt;/p&gt;&lt;p&gt;Me doesn&amp;#39;t know.&lt;br /&gt;I am not magician yet I am just studying to become him.&lt;/p&gt;&lt;p&gt;And I do not even want to know sincу I do not see much sense in it &lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;BLOCKQUOTE&gt;&lt;div&gt;&lt;img src="/Themes/infopathdev/images/icon-quote.gif"&gt; &lt;strong&gt;Doreen:&lt;/strong&gt;&lt;/div&gt;&lt;div&gt;Example:
 there are two buttons.&amp;nbsp; User clicks 1st button, it fires off&amp;nbsp;(no rules,
 just code behind), the code behind of 1st button causes&amp;nbsp;2nd button to 
fire off (2nd button has rules, no code). The user never physically 
clicks the 2nd button&lt;/div&gt;&lt;/BLOCKQUOTE&gt;&lt;/p&gt;&lt;p&gt;Never never? ever? &lt;br /&gt;Why do you need such a button?&lt;/p&gt;&lt;p&gt;&amp;nbsp;Why don&amp;#39;t you simply copy the same rules from 2nd button to 1st one? &lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;BLOCKQUOTE&gt;&lt;div&gt;&lt;img src="/Themes/infopathdev/images/icon-quote.gif"&gt; &lt;strong&gt;Doreen:&lt;/strong&gt;&lt;/div&gt;&lt;div&gt;THANK YOU for submitting&amp;nbsp;code to try.&amp;nbsp; I 
had no idea I could do this with the InternalStartup button code...I 
haven&amp;#39;t tryed it yet but I definately will and follow up.&amp;nbsp;Sorry for the 
unclarity of my first message.&lt;/p&gt;&lt;p&gt;Doreen&lt;/div&gt;&lt;/BLOCKQUOTE&gt;&lt;/p&gt;&lt;p&gt;It is not &amp;quot;InternalStartup button code&amp;quot;&lt;br /&gt;And you do not need to think anything&lt;/p&gt;&lt;p&gt;Clicking &lt;b&gt;&amp;quot;Edit Form Code...&amp;quot;&lt;/b&gt; button in the properties of one &lt;b&gt;CTRL2_5&lt;/b&gt; button inserts &lt;/p&gt;&lt;ul&gt;&lt;li&gt;&lt;span style="font-family:arial;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;orphans:2;text-align:-webkit-auto;text-indent:0px;text-transform:none;white-space:normal;widows:2;word-spacing:0px;-webkit-text-size-adjust:auto;-webkit-text-stroke-width:0px;font-size:small;float:none;"&gt;((ButtonEvent)EventManager.ControlEvents[&amp;quot;CTRL2_5&amp;quot;]).Clicked += new ClickedEventHandler(CTRL2_5_Clicked);&lt;/span&gt;&amp;nbsp;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;into &lt;span style="font-family:arial;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;orphans:2;text-indent:0px;text-transform:none;white-space:normal;widows:2;word-spacing:0px;font-size:small;float:none;"&gt;InternalStartup()&lt;/span&gt;&lt;/p&gt;&lt;p&gt;And&amp;nbsp; Clicking &lt;b&gt;&amp;quot;Edit Form Code...&amp;quot;&lt;/b&gt; button in the properties of one &lt;b&gt;CTRL3_5&lt;/b&gt; button inserts&lt;/p&gt;
&lt;ul&gt;&lt;li&gt;&lt;span style="font-family:arial;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;orphans:2;text-align:-webkit-auto;text-indent:0px;text-transform:none;white-space:normal;widows:2;word-spacing:0px;-webkit-text-size-adjust:auto;-webkit-text-stroke-width:0px;font-size:small;float:none;"&gt;((ButtonEvent)EventManager.ControlEvents[&amp;quot;&lt;b&gt;CTRL3_5&lt;/b&gt;&amp;quot;]).Clicked += new ClickedEventHandler(&lt;b&gt;CTRL3_5_Clicked&lt;/b&gt;);&lt;/span&gt;&amp;nbsp;&lt;/li&gt;&lt;/ul&gt;
&lt;p&gt;into &lt;span style="font-family:arial;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;orphans:2;text-indent:0px;text-transform:none;white-space:normal;widows:2;word-spacing:0px;font-size:small;float:none;"&gt;InternalStartup()&lt;/span&gt; &lt;br /&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item><item><title>Re: Perform a button click through code</title><link>https://www.infopathdev.com:443/forums/thread/80032.aspx</link><pubDate>Fri, 29 Jun 2012 20:39:27 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:80032</guid><dc:creator>Gennady Vanin (Геннадий Ванин, Новосибирск)</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/80032.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=80032</wfw:commentRss><description>&lt;p&gt;&lt;BLOCKQUOTE&gt;&lt;div&gt;&lt;img src="/Themes/infopathdev/images/icon-quote.gif"&gt; &lt;strong&gt;Jimmy:&lt;/strong&gt;&lt;/div&gt;&lt;div&gt;Perhaps I&amp;#39;m confused, but does that accomplish anything different from doing this (which would be preferable to tampering with the InternalStartup method):&lt;/div&gt;&lt;/BLOCKQUOTE&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;No, it does not differ&lt;br /&gt;I even did not think much&lt;br /&gt;&lt;/p&gt;&lt;p&gt;My approach consists in changing one symbol in code.&lt;br /&gt;Your approach requires a lot more typing&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&amp;quot;Tampering&amp;quot; sounds to me synonymous to &amp;quot;cracking&amp;quot;.&lt;br /&gt;Isn&amp;#39;t user tampering when he presses &amp;quot;Edit Form Code...&amp;quot; button inserting:&lt;/p&gt;&lt;blockquote&gt;&lt;p&gt;&lt;span style="font-family:arial;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;orphans:2;text-align:-webkit-auto;text-indent:0px;text-transform:none;white-space:normal;widows:2;word-spacing:0px;-webkit-text-size-adjust:auto;-webkit-text-stroke-width:0px;font-size:small;float:none;"&gt;((ButtonEvent)EventManager.ControlEvents[&amp;quot;CTRL2_5&amp;quot;]).Clicked += new ClickedEventHandler(CTRL2_5_Clicked);&lt;/span&gt; &lt;br /&gt;&lt;/p&gt;&lt;/blockquote&gt;&lt;p&gt;&amp;nbsp;into&amp;nbsp; &lt;span style="font-family:Verdana;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;orphans:2;text-align:left;text-indent:0px;text-transform:none;white-space:normal;widows:2;word-spacing:0px;float:none;"&gt;&lt;span class="Apple-converted-space"&gt;&lt;/span&gt;InternalStartup method?&lt;/span&gt;&lt;/p&gt;&lt;p&gt;Me too - confused what&amp;#39;s wrong in what I have done &lt;br /&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item><item><title>Re: Perform a button click through code</title><link>https://www.infopathdev.com:443/forums/thread/80016.aspx</link><pubDate>Fri, 29 Jun 2012 18:41:49 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:80016</guid><dc:creator>Jimmy</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/80016.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=80016</wfw:commentRss><description>&lt;p&gt;&lt;BLOCKQUOTE&gt;&lt;div&gt;&lt;img src="/Themes/infopathdev/images/icon-quote.gif"&gt; &lt;strong&gt;My Self The Enemy:&lt;/strong&gt;&lt;/div&gt;&lt;div&gt;public void InternalStartup()&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&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; ((ButtonEvent)EventManager.ControlEvents[&amp;quot;CTRL2_5&amp;quot;]).Clicked += new ClickedEventHandler(CTRL2_5_Clicked);&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; ((ButtonEvent)EventManager.ControlEvents[&amp;quot;CTRL3_5&amp;quot;]).Clicked += new ClickedEventHandler(&lt;b&gt;CTRL3_5_Clicked&lt;/b&gt;);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;&lt;br /&gt;In oder to perform the same method, for example &lt;b&gt;CTRL2_5_Clicked() on clicking both buttons,&lt;/b&gt; change it to &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; public void InternalStartup()&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&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; ((ButtonEvent)EventManager.ControlEvents[&amp;quot;CTRL2_5&amp;quot;]).Clicked += new ClickedEventHandler(CTRL2_5_Clicked);&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; ((ButtonEvent)EventManager.ControlEvents[&amp;quot;CTRL3_5&amp;quot;]).Clicked += new ClickedEventHandler(&lt;b&gt;CTRL2_5_Clicked&lt;/b&gt;);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; } &lt;br /&gt;&lt;/div&gt;&lt;/BLOCKQUOTE&gt;

&lt;/p&gt;&lt;p&gt;Perhaps I&amp;#39;m confused, but does that accomplish anything different from doing this (which would be preferable to tampering with the InternalStartup method):&lt;/p&gt;&lt;p&gt;

void PerformSubmit()
&lt;br /&gt;{
&lt;br /&gt;&amp;nbsp;&amp;nbsp; // Do stuff
&lt;br /&gt;}

&lt;br /&gt;&lt;br /&gt;void CTRL2_5_Clicked(object sender, EventArgs e)
&lt;br /&gt;{
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;// Print page
      &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; PerformSubmit();
&lt;br /&gt;}
 

&lt;br /&gt;&lt;br /&gt;void CTRL3_5_Clicked(object sender, EventArgs e)
&lt;br /&gt;{
      &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; PerformSubmit();
&lt;br /&gt;}

&lt;br /&gt;&lt;br /&gt;I would have suggested this sooner, but I thought Doreen was looking for a way to run the Submit button&amp;#39;s rules after printing the page, which would be more complicated.&lt;/p&gt;</description></item><item><title>Re: Perform a button click through code</title><link>https://www.infopathdev.com:443/forums/thread/80014.aspx</link><pubDate>Fri, 29 Jun 2012 18:37:14 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:80014</guid><dc:creator>Gennady Vanin (Геннадий Ванин, Новосибирск)</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/80014.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=80014</wfw:commentRss><description>&lt;p&gt;&lt;BLOCKQUOTE&gt;&lt;div&gt;&lt;img src="/Themes/infopathdev/images/icon-quote.gif"&gt; &lt;strong&gt;Rocksandmountains:&lt;/strong&gt;&lt;/div&gt;&lt;div&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;Oh, there&amp;#39;s a god out there. &lt;/p&gt;&lt;p&gt;You saved us. Thanks for the &amp;quot;secret formula&amp;quot;, I&amp;#39;m having a bit of issues with coding in InfoPath. So not user-friendly...&amp;nbsp; &lt;/div&gt;&lt;/BLOCKQUOTE&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Thanks, &lt;a href="http://en.wikipedia.org/wiki/I_Am_that_I_Am" title="That&amp;#39;s me"&gt;I am what I am&amp;nbsp; &lt;/a&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;I am to agree. This &amp;quot;codeless&amp;quot; approach is a just deceptiive trap even for seasoned developers and next-to-impossible to explain to employer what&amp;#39;s the problems with &amp;quot;too easy&amp;quot; but in reality impossible tasks. I&amp;#39;ve just lost employment due to this without being paid for 6-week work&lt;br /&gt;&lt;/p&gt;&lt;p&gt;That is, it is easier to code than to overcome all pitfalls, traps, bugs, steep learning curves of this &amp;quot;codeless&amp;quot;&amp;nbsp; (Infopath) approach&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item><item><title>Re: Perform a button click through code</title><link>https://www.infopathdev.com:443/forums/thread/80013.aspx</link><pubDate>Fri, 29 Jun 2012 18:27:47 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:80013</guid><dc:creator>Doreen</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/80013.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=80013</wfw:commentRss><description>&lt;p&gt;Rocksandmountains, &lt;/p&gt;&lt;p&gt;I feel your pain.&lt;/p&gt;</description></item><item><title>Re: Perform a button click through code</title><link>https://www.infopathdev.com:443/forums/thread/80012.aspx</link><pubDate>Fri, 29 Jun 2012 18:22:38 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:80012</guid><dc:creator>Doreen</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/80012.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=80012</wfw:commentRss><description>&lt;p&gt;Gennady Vanin&lt;strong&gt;,&lt;/strong&gt;&lt;/p&gt;&lt;p&gt;Yes I am using InfoPath 2007, and my question is: I want to know how to fire off a 2nd button programmatically when user clicks the 1st button.&lt;/p&gt;&lt;p&gt;Example: there are two buttons.&amp;nbsp; User clicks 1st button, it fires off&amp;nbsp;(no rules, just code behind), the code behind of 1st button causes&amp;nbsp;2nd button to fire off (2nd button has rules, no code). The user never physically clicks the 2nd button.&lt;/p&gt;&lt;p&gt;THANK YOU for submitting&amp;nbsp;code to try.&amp;nbsp; I had no idea I could do this with the InternalStartup button code...I haven&amp;#39;t tryed it yet but I definately will and follow up.&amp;nbsp;Sorry for the unclarity of my first message.&lt;/p&gt;&lt;p&gt;Doreen&lt;br /&gt;&lt;/p&gt;</description></item><item><title>Re: Perform a button click through code</title><link>https://www.infopathdev.com:443/forums/thread/79982.aspx</link><pubDate>Fri, 29 Jun 2012 15:19:11 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:79982</guid><dc:creator>Gennady Vanin (Геннадий Ванин, Новосибирск)</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/79982.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=79982</wfw:commentRss><description>&lt;p style="font-family:arial;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;orphans:2;text-align:-webkit-auto;text-indent:0px;text-transform:none;white-space:normal;widows:2;word-spacing:0px;-webkit-text-size-adjust:auto;-webkit-text-stroke-width:0px;font-size:small;"&gt;Are you asking about Infopath 2007?&lt;br /&gt;Are asking about performing the same action by clicking both on one button and another?&lt;br /&gt;&lt;br /&gt;I am on Infopath 2010 and can post you the code for it if you are interested but I am still uncertain what you are asking about&lt;br /&gt;&lt;br /&gt;On 1st and 2nd button&amp;#39;s properties in button&amp;#39;s code click &amp;quot;Edit code...&amp;quot;&amp;nbsp; button (under General tab), having in its &amp;quot;Action:&amp;quot; drop-down list::&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;b&gt;Rules and custom code&lt;/b&gt;&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;chosen&lt;/p&gt;&lt;p style="font-family:arial;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;orphans:2;text-align:-webkit-auto;text-indent:0px;text-transform:none;white-space:normal;widows:2;word-spacing:0px;-webkit-text-size-adjust:auto;-webkit-text-stroke-width:0px;font-size:small;"&gt;&amp;nbsp;&lt;img src="https://mail.google.com/mail/ca/u/0/?ui=2&amp;amp;ik=4e0edcd321&amp;amp;view=att&amp;amp;th=1383995865bee7c1&amp;amp;attid=0.2&amp;amp;disp=safe&amp;amp;realattid=ii_138399482ee0395d&amp;amp;zw" alt="Inline image 1" /&gt;&lt;/p&gt;&lt;p style="font-family:arial;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;orphans:2;text-align:-webkit-auto;text-indent:0px;text-transform:none;white-space:normal;widows:2;word-spacing:0px;-webkit-text-size-adjust:auto;-webkit-text-stroke-width:0px;font-size:small;"&gt;These (2 clicks) will generate:&lt;/p&gt;&lt;blockquote style="font-family:arial;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;orphans:2;text-align:-webkit-auto;text-indent:0px;text-transform:none;white-space:normal;widows:2;word-spacing:0px;-webkit-text-size-adjust:auto;-webkit-text-stroke-width:0px;font-size:small;margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:40px;border-top-style:none;border-right-style:none;border-bottom-style:none;border-left-style:none;border-width:initial;border-color:initial;border-image:initial;padding-top:0px;padding-right:0px;padding-bottom:0px;padding-left:0px;"&gt;&lt;p&gt;public void InternalStartup()&lt;/p&gt;&lt;/blockquote&gt;&lt;blockquote style="font-family:arial;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;orphans:2;text-align:-webkit-auto;text-indent:0px;text-transform:none;white-space:normal;widows:2;word-spacing:0px;-webkit-text-size-adjust:auto;-webkit-text-stroke-width:0px;font-size:small;margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:40px;border-top-style:none;border-right-style:none;border-bottom-style:none;border-left-style:none;border-width:initial;border-color:initial;border-image:initial;padding-top:0px;padding-right:0px;padding-bottom:0px;padding-left:0px;"&gt;&lt;p&gt;{&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;((ButtonEvent)EventManager.ControlEvents[&amp;quot;CTRL2_5&amp;quot;]).Clicked += new ClickedEventHandler(CTRL2_5_Clicked);&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;((ButtonEvent)EventManager.ControlEvents[&amp;quot;CTRL3_5&amp;quot;]).Clicked += new ClickedEventHandler(&lt;b&gt;CTRL3_5_Clicked&lt;/b&gt;);&lt;/p&gt;&lt;p&gt;}&lt;/p&gt;&lt;/blockquote&gt;&lt;p style="font-family:arial;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;orphans:2;text-align:-webkit-auto;text-indent:0px;text-transform:none;white-space:normal;widows:2;word-spacing:0px;-webkit-text-size-adjust:auto;-webkit-text-stroke-width:0px;font-size:small;"&gt;&lt;br /&gt;In oder to perform the same method, for example&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;&lt;b&gt;CTRL2_5_Clicked() on clicking both buttons,&lt;/b&gt;&lt;span class="Apple-converted-space"&gt;&amp;nbsp;&lt;/span&gt;change it to&amp;nbsp;&lt;/p&gt;&lt;blockquote style="font-family:arial;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;orphans:2;text-align:-webkit-auto;text-indent:0px;text-transform:none;white-space:normal;widows:2;word-spacing:0px;-webkit-text-size-adjust:auto;-webkit-text-stroke-width:0px;font-size:small;margin-top:0px;margin-right:0px;margin-bottom:0px;margin-left:40px;border-top-style:none;border-right-style:none;border-bottom-style:none;border-left-style:none;border-width:initial;border-color:initial;border-image:initial;padding-top:0px;padding-right:0px;padding-bottom:0px;padding-left:0px;"&gt;&lt;p&gt;public void InternalStartup()&lt;/p&gt;&lt;p&gt;{&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;((ButtonEvent)EventManager.ControlEvents[&amp;quot;CTRL2_5&amp;quot;]).Clicked += new ClickedEventHandler(CTRL2_5_Clicked);&lt;/p&gt;&lt;p&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;((ButtonEvent)EventManager.ControlEvents[&amp;quot;CTRL3_5&amp;quot;]).Clicked += new ClickedEventHandler(&lt;b&gt;CTRL2_5_Clicked&lt;/b&gt;);&lt;/p&gt;&lt;p&gt;}&lt;/p&gt;&lt;/blockquote&gt;&lt;p style="font-family:arial;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;orphans:2;text-align:-webkit-auto;text-indent:0px;text-transform:none;white-space:normal;widows:2;word-spacing:0px;-webkit-text-size-adjust:auto;-webkit-text-stroke-width:0px;font-size:small;"&gt;&amp;nbsp;&lt;/p&gt;</description></item><item><title>Re: Perform a button click through code</title><link>https://www.infopathdev.com:443/forums/thread/79975.aspx</link><pubDate>Fri, 29 Jun 2012 14:49:04 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:79975</guid><dc:creator>Doreen</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/79975.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=79975</wfw:commentRss><description>&lt;p&gt;I realize what I sited is related to Windows forms only - I was using this as an example of a functionality I was looking to acheive in InfoPath form code.  If it can&amp;#39;t be done, then that is all I want to know.  If it can be done I&amp;#39;d like help on making it happen.&lt;/p&gt;</description></item><item><title>Re: Perform a button click through code</title><link>https://www.infopathdev.com:443/forums/thread/79965.aspx</link><pubDate>Fri, 29 Jun 2012 10:43:30 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:79965</guid><dc:creator>Gennady Vanin (Геннадий Ванин, Новосибирск)</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/79965.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=79965</wfw:commentRss><description>&lt;p&gt;&lt;BLOCKQUOTE&gt;&lt;div&gt;&lt;img src="/Themes/infopathdev/images/icon-quote.gif"&gt; &lt;strong&gt;Doreen:&lt;/strong&gt;&lt;/div&gt;&lt;div&gt;In Windows forms there is a&amp;nbsp;method to perform a button click&amp;nbsp;called &lt;em&gt;PerformClick()&lt;/em&gt; described by msdn article here: &lt;a href="http://msdn.microsoft.com/en-us/library/hkkb40tf%28VS.90%29.aspx"&gt;http://msdn.microsoft.com/en-us/library/hkkb40tf(VS.90).aspx&lt;/a&gt; &lt;/p&gt;&lt;p&gt;This didn&amp;#39;t work in Infopath 2007 for me. I set it up&amp;nbsp;like the example in the article&amp;nbsp;referencing the&amp;nbsp;Infopath button control&amp;nbsp;ID like this: &lt;strong&gt;CTRL71_11.&lt;/strong&gt;PerformClick();&amp;nbsp; Is there a way to do this in InfoPath?&amp;nbsp; I assume I have to use some xml type coding which I am not yet familiar with how to code&amp;nbsp;&amp;nbsp; &lt;/p&gt;&lt;p&gt;Example code from msdn article:&lt;/p&gt;&lt;p&gt;In button1 click event:&lt;/p&gt;&lt;p&gt;&lt;em&gt;MessageBox.Show(&lt;span&gt;&amp;quot;button1.Click was raised.&amp;quot;&lt;/span&gt;);&lt;/em&gt;&lt;/p&gt;&lt;p&gt;-----&lt;/p&gt;&lt;p&gt;In button2 click event:&lt;br /&gt;&lt;span style="color:green;"&gt;// Call the Click event of button1.&lt;/span&gt;&lt;br /&gt;&lt;em&gt;button1.PerformClick();&lt;/em&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;I want to have a print button with code (this.print()), &amp;nbsp;that calls a submit button with rules (rules will name the form, submit it to SharePoint library and close the form).&lt;/p&gt;&lt;p&gt;Can anyone help me code this?&lt;/p&gt;&lt;p&gt;&lt;/div&gt;&lt;/BLOCKQUOTE&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;IMO, this your cited method is unrelated to coding in Infopath form since in the former the button is defined statically and known at compile time, an in the latter (in case of Infopath form) the code is for &lt;b&gt;add-on&lt;/b&gt; and for objects constructed dynamically at run-time (the objects there, at run-time ebvironment,&amp;nbsp; can even be added, removed or re-defined). &amp;nbsp;&lt;/p&gt;&lt;p&gt;If you want to do the same in compatible with Infopath approaches without trying to overcomplicate and make impossible the simple things then it is not the problem. &lt;br /&gt;&lt;/p&gt;&lt;p&gt;Infopath form is just XML (msotly XML) data for a form that is to be used by external tools which Infopath form is not even aware of.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item><item><title>Perform a button click through code</title><link>https://www.infopathdev.com:443/forums/thread/79925.aspx</link><pubDate>Thu, 28 Jun 2012 15:39:10 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:79925</guid><dc:creator>Doreen</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/79925.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=39&amp;PostID=79925</wfw:commentRss><description>&lt;p&gt;In Windows forms there is a&amp;nbsp;method to perform a button click&amp;nbsp;called &lt;em&gt;PerformClick()&lt;/em&gt; described by msdn article here: &lt;a href="http://msdn.microsoft.com/en-us/library/hkkb40tf(VS.90).aspx"&gt;http://msdn.microsoft.com/en-us/library/hkkb40tf(VS.90).aspx&lt;/a&gt; &lt;/p&gt;&lt;p&gt;This didn&amp;#39;t work in Infopath 2007 for me. I set it up&amp;nbsp;like the example in the article&amp;nbsp;referencing the&amp;nbsp;Infopath button control&amp;nbsp;ID like this: &lt;strong&gt;CTRL71_11.&lt;/strong&gt;PerformClick();&amp;nbsp; Is there a way to do this in InfoPath?&amp;nbsp; I assume I have to use some xml type coding which I am not yet familiar with how to code&amp;nbsp;&amp;nbsp; &lt;/p&gt;&lt;p&gt;Example code from msdn article:&lt;/p&gt;&lt;p&gt;In button1 click event:&lt;/p&gt;&lt;p&gt;&lt;em&gt;MessageBox.Show(&lt;span&gt;&amp;quot;button1.Click was raised.&amp;quot;&lt;/span&gt;);&lt;/em&gt;&lt;/p&gt;&lt;p&gt;-----&lt;/p&gt;&lt;p&gt;In button2 click event:&lt;br /&gt;&lt;span style="color:green;"&gt;// Call the Click event of button1.&lt;/span&gt;&lt;br /&gt;&lt;em&gt;button1.PerformClick();&lt;/em&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;I want to have a print button with code (this.print()), &amp;nbsp;that calls a submit button with rules (rules will name the form, submit it to SharePoint library and close the form).&lt;/p&gt;&lt;p&gt;Can anyone help me code this?&lt;/p&gt;</description></item></channel></rss>