<?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>General</title><link>https://www.infopathdev.com:443/forums/41.aspx</link><description>If you're not sure where to ask your question, ask it here. If necessary, our moderators will make sure it gets classified in the correct board.</description><dc:language>en</dc:language><generator>CommunityServer 2007 SP3 (Build: 31118.962)</generator><item><title>Re: Assigning a button on Infopath form to execute an exe on local drive</title><link>https://www.infopathdev.com:443/forums/thread/86193.aspx</link><pubDate>Fri, 18 Jan 2013 16:23:42 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:86193</guid><dc:creator>Hilary Stoupa</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/86193.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=86193</wfw:commentRss><description>&lt;p&gt;Hi - couple of things - do you know how to run your project in debug so you can see what is happening in your code when it executes? &lt;a href="http://www.infopathdev.com/blogs/hilary/archive/2009/09/27/debug-managed-code-in-vsta-for-the-accidental-programmer.aspx"&gt;Here&amp;#39;s&lt;/a&gt; my blog on that, and &lt;a href="http://www.google.com/url?sa=t&amp;amp;rct=j&amp;amp;q=run%20in%20debug%20infopath&amp;amp;source=web&amp;amp;cd=1&amp;amp;cad=rja&amp;amp;ved=0CDIQFjAA&amp;amp;url=http%3A%2F%2Fmsdn.microsoft.com%2Fen-us%2Flibrary%2Faa947485(v%3Doffice.11).aspx&amp;amp;ei=SHX5UKirHuiyigLf_4GgCw&amp;amp;usg=AFQjCNHGmAnU5T28l2Q9NV4N3yB8imawIA&amp;amp;bvm=bv.41248874,d.cGE"&gt;here&amp;#39;s&lt;/a&gt; an MSDN article.&lt;/p&gt;&lt;p&gt;Second, I&amp;#39;m wondering if you could just use Process.Start - You&amp;#39;ll find examples &lt;a href="http://msdn.microsoft.com/en-us/library/53ezey2s(v=vs.80).aspx?cs-save-lang=1&amp;amp;cs-lang=vb#code-snippet-1"&gt;here&lt;/a&gt;.&lt;/p&gt;</description></item><item><title>Re: Assigning a button on Infopath form to execute an exe on local drive</title><link>https://www.infopathdev.com:443/forums/thread/86187.aspx</link><pubDate>Fri, 18 Jan 2013 13:52:51 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:86187</guid><dc:creator>NICK1081</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/86187.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=86187</wfw:commentRss><description>&lt;p&gt;thanks for the reply. I&amp;#39;m not sure what you are suggesting specifically, and/or how/why that would help. &lt;/p&gt;
&lt;p&gt;Have you ever been able to get something like this to function effectively? If so, how did you proceed? What was the code used and related configuration parameters?&lt;/p&gt;
&lt;p&gt;Thanks again for your quick reply.&lt;/p&gt;</description></item><item><title>Re: Assigning a button on Infopath form to execute an exe on local drive</title><link>https://www.infopathdev.com:443/forums/thread/86181.aspx</link><pubDate>Fri, 18 Jan 2013 09:21:11 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:86181</guid><dc:creator>john111</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/86181.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=86181</wfw:commentRss><description>Try using different names when declaring variables.</description></item><item><title>Assigning a button on Infopath form to execute an exe on local drive</title><link>https://www.infopathdev.com:443/forums/thread/86173.aspx</link><pubDate>Fri, 18 Jan 2013 04:44:27 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:86173</guid><dc:creator>NICK1081</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/86173.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=41&amp;PostID=86173</wfw:commentRss><description>&lt;p&gt;I am new at this so try not to laugh too hard if you find my ignorance amusing.&lt;/p&gt;
&lt;p&gt;I&amp;#39;ve been teaching for 30 years and I have observed that one of the toughest obstacles for&amp;nbsp;a student to overcome is others laughng at a sincere question. So please be kind. i realize there are MANY of you out there who are much smarter than I in this area. I&amp;#39;m OK with that. I&amp;#39;m a humble guy.&amp;nbsp;&amp;nbsp; :-)&lt;/p&gt;
&lt;p&gt;I am trying to run a program&amp;nbsp;via a button in an&amp;nbsp;InfoPath form. &lt;/p&gt;
&lt;p&gt;I have set security to Full Trust.&lt;/p&gt;
&lt;p&gt;I have added Reference... &lt;strong&gt;Windows Script Host Object Model&lt;/strong&gt; &lt;/p&gt;
&lt;p&gt;the button code is as follows:&lt;/p&gt;&lt;font size="2"&gt;
&lt;p&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;Public&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;Sub&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; CTRL1_5_Clicked(&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;ByVal&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; sender &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;As&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;Object&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;, &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;ByVal&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; e &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;As&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; ClickedEventArgs)&lt;/p&gt;&lt;/font&gt;&lt;font size="2"&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;Dim&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; WshShell &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;As&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; IWshRuntimeLibrary.IWshShell&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; 
&lt;p&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;Dim&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; CreateObject&lt;/p&gt;WshShell = Createobject(&lt;/font&gt;&lt;font color="#800000" size="2"&gt;&lt;font color="#800000" size="2"&gt;&amp;quot;WScript.Shell&amp;quot;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;)&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; 
&lt;p&gt;WshShell.Run(&lt;/font&gt;&lt;font color="#800000" size="2"&gt;&lt;font color="#800000" size="2"&gt;&amp;quot;c:\icmxfer.exe&amp;quot;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;)&lt;/p&gt;
&lt;p&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;End&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; &lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;Sub&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;I have no errors reported in the code windows I was getting an error before I added the &amp;quot;Dim CreateObject&amp;quot;&lt;/p&gt;
&lt;p&gt;Error&amp;nbsp;1&amp;nbsp;Name &amp;#39;Createobject&amp;#39; is not declared.&amp;nbsp;C:\VB4InfoPath\test456\FormCode.vb&amp;nbsp;34&amp;nbsp;24&amp;nbsp;test456&lt;br /&gt;I realize what I have done is probably bogus but I am not familiar enough (yet) with the appropriate way to code this.&lt;/p&gt;
&lt;p&gt;I do have 2 warnings:&lt;/p&gt;
&lt;p&gt;Warning&amp;nbsp;1&amp;nbsp;Variable declaration without an &amp;#39;As&amp;#39; clause; type of Object assumed.&amp;nbsp;C:\VB4InfoPath\test456\FormCode.vb&amp;nbsp;33&amp;nbsp;17&amp;nbsp;test456&lt;br /&gt;Warning&amp;nbsp;2&amp;nbsp;Variable &amp;#39;CreateObject&amp;#39; is used before it has been assigned a value. A null reference exception could result at runtime.&amp;nbsp;C:\VB4InfoPath\test456\FormCode.vb&amp;nbsp;34&amp;nbsp;24&amp;nbsp;test456&lt;/p&gt;
&lt;p&gt;I am getting the following errors when I test the button.&lt;/p&gt;
&lt;p&gt;System.NullReferenceException&lt;br /&gt;Object variable or With block variable not set.&lt;br /&gt;&amp;nbsp;&amp;nbsp; at Microsoft.VisualBasic.CompilerServices.Symbols.Container..ctor(Object Instance)&lt;br /&gt;&amp;nbsp;&amp;nbsp; at Microsoft.VisualBasic.CompilerServices.NewLateBinding.InternalLateIndexGet(Object Instance, Object[] Arguments, String[] ArgumentNames, Boolean ReportErrors, ResolutionFailure&amp;amp; Failure)&lt;br /&gt;&amp;nbsp;&amp;nbsp; at Microsoft.VisualBasic.CompilerServices.NewLateBinding.LateIndexGet(Object Instance, Object[] Arguments, String[] ArgumentNames)&lt;br /&gt;&amp;nbsp;&amp;nbsp; at test456.FormCode.CTRL1_5_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;&lt;/p&gt;</description></item></channel></rss>