<?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: opening an external URL from VB code (infopath 2010)</title><link>https://www.infopathdev.com:443/forums/thread/73951.aspx</link><pubDate>Fri, 13 Jan 2012 10:27:30 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:73951</guid><dc:creator>paolo</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/73951.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=73951</wfw:commentRss><description>&lt;p&gt;&amp;nbsp;OK, let me explain what I did for future reference.&lt;/p&gt;&lt;p&gt;I managed to make this work with self-generated certificates. Obviously this&lt;/p&gt;&lt;p&gt;is not optimal, but is a solution I could implement right away...&amp;nbsp; Hope this may&lt;/p&gt;&lt;p&gt;be helpful for someone in the future. &lt;br /&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;I generated a certificate using the &amp;quot;Digital Certificate for VBA Projects&amp;quot; applications&lt;/p&gt;&lt;p&gt;from Office 2010. That would generate a certificate that is valid for 6 years but is&lt;/p&gt;&lt;p&gt;only recognized by the machine where is generated. I created my form template&lt;/p&gt;&lt;p&gt;using this certificate and exported the form. I would then go to the machine where&lt;/p&gt;&lt;p&gt;I need the form to run and open the exported form. I get a security warning message,&lt;/p&gt;&lt;p&gt;and from there i would click on the link to view the certificate, examine the details and&lt;/p&gt;&lt;p&gt;look for the &amp;quot;export certificate&amp;quot; button. Clicking that opens a wizard - on the second&lt;/p&gt;&lt;p&gt;page I selected as the destination for the export &amp;quot;Trusted Root Certification Authorities&amp;quot;.&lt;/p&gt;&lt;p&gt;Next time I open the form, the security warning comes up again, and now I can click&lt;/p&gt;&lt;p&gt;on &amp;quot;trust all documents from this publisher&amp;quot;. Done - from now on it works with no&lt;/p&gt;&lt;p&gt;security warning and the form runs as full trust. Just repeats this for every machine&lt;/p&gt;&lt;p&gt;where the forms need to run. &lt;br /&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item><item><title>Re: opening an external URL from VB code (infopath 2010)</title><link>https://www.infopathdev.com:443/forums/thread/73716.aspx</link><pubDate>Tue, 10 Jan 2012 14:09:15 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:73716</guid><dc:creator>paolo</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/73716.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=73716</wfw:commentRss><description>&lt;p&gt;&amp;nbsp;Thanks for your reply...&amp;nbsp; that&amp;#39;s what I was afraid of.&lt;/p&gt;&lt;p&gt;When I set the form for full trust, I will need to install a security certificate or digitally sign the form.&lt;/p&gt;&lt;p&gt;This is not something I am very familiar with, so before I start, I have a few general questions. &lt;br /&gt;&lt;/p&gt;&lt;p&gt;In the case where I have several form, running on different computers and different users,&lt;/p&gt;&lt;p&gt;will I need to provide a different certificate for every form or for every machine or user?&lt;/p&gt;&lt;p&gt;Or will one certificate be enough to cover all the forms on different machines and users? &lt;/p&gt;&lt;p&gt;Thanks,&lt;/p&gt;&lt;p&gt;Paolo &lt;br /&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item><item><title>Re: opening an external URL from VB code (infopath 2010)</title><link>https://www.infopathdev.com:443/forums/thread/73702.aspx</link><pubDate>Tue, 10 Jan 2012 10:48:49 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:73702</guid><dc:creator>Jimmy</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/73702.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=73702</wfw:commentRss><description>&lt;p&gt;Approach 2 should work, and I reckon 3 would too.&amp;nbsp; The issue is that anything as invasive as starting other processes is going to require your form to be full trust (that&amp;#39;s what those SecurityExceptions mean).&amp;nbsp; Please try again after setting your form to full trust.&lt;/p&gt;
&lt;p&gt;You can also have windows open the url in the default browser by using Process.Start(&lt;em&gt;url&lt;/em&gt;), but that will require full trust just the same.&lt;/p&gt;</description></item><item><title>Re: opening an external URL from VB code (infopath 2010)</title><link>https://www.infopathdev.com:443/forums/thread/73701.aspx</link><pubDate>Tue, 10 Jan 2012 10:41:11 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:73701</guid><dc:creator>Patrick Halstead</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/73701.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=73701</wfw:commentRss><description>&lt;p&gt;Hi Paolo,&lt;/p&gt;&lt;p&gt;qRules contains a command that does this. If nobody replies with code advice, you could install the free trial and use that command. We&amp;#39;d be more than happy to share the code for it (it&amp;#39;s written in C#); maybe Hilary or Jimmy will respond with that ... &lt;/p&gt;</description></item><item><title>Re: opening an external URL from VB code (infopath 2010)</title><link>https://www.infopathdev.com:443/forums/thread/73694.aspx</link><pubDate>Tue, 10 Jan 2012 07:34:06 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:73694</guid><dc:creator>paolo</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/73694.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=73694</wfw:commentRss><description>&lt;p&gt;&amp;nbsp;Well, I am going to list here what I tried (and failed).&lt;/p&gt;&lt;p&gt;1) code:&lt;/p&gt;&lt;blockquote&gt;&lt;p&gt;Dim Explorer As Object&lt;br /&gt;
    Set Explorer = CreateObject(&amp;quot;InternetExplorer.Application&amp;quot;) &lt;/p&gt;&lt;/blockquote&gt;&lt;p&gt;&amp;nbsp;fails with error: Name &amp;#39; Create Object&amp;#39; is not declared&lt;/p&gt;&lt;p&gt;2) code:&lt;/p&gt;&lt;blockquote&gt;&lt;p&gt;&amp;nbsp;System.Diagnostics.Process.Start(&amp;quot;iexplore.exe&amp;quot;,&amp;quot;www.google.com&amp;quot;)&lt;/p&gt;&lt;/blockquote&gt;&lt;p&gt;&amp;nbsp;fails with a System.Security.SecurityException error.&lt;/p&gt;&lt;p&gt;3) code:&lt;/p&gt;&lt;blockquote&gt;&lt;p&gt;&amp;nbsp;Microsoft.VisualBasic.Interaction.Shell(&amp;quot;iexplore.exe&amp;quot;) &lt;br /&gt;&lt;/p&gt;&lt;/blockquote&gt;&lt;p&gt;&amp;nbsp;fails triggering a security exception.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;Will update here as I try more option and state whether they succeed or fail...&lt;br /&gt;&lt;/p&gt;</description></item><item><title>opening an external URL from VB code (infopath 2010)</title><link>https://www.infopathdev.com:443/forums/thread/73639.aspx</link><pubDate>Mon, 09 Jan 2012 12:06:26 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:73639</guid><dc:creator>paolo</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/73639.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=73639</wfw:commentRss><description>&lt;p&gt;Hallo,&lt;/p&gt;
&lt;p&gt;I would like to open an external URL in IE from infopath 2010 using VB code. &lt;/p&gt;
&lt;p&gt;I looked&amp;nbsp;here for a solution, and found a post with a javascript solution, which is&lt;/p&gt;
&lt;p&gt;not applicable to infopath 2010. Therefore I am posting again.&lt;/p&gt;
&lt;p&gt;I would like to find a VB way of doing it.&lt;/p&gt;
&lt;p&gt;Basically, I just need to spawn an&amp;nbsp;Internet Explorer session with a give URL from&lt;/p&gt;
&lt;p&gt;my infopath form. Any suggestion is appreciated. I know how to place code in the&lt;/p&gt;
&lt;p&gt;right spot, just need the command to spawn IE or open an URL.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Thanks,&lt;/p&gt;
&lt;p&gt;Paolo Grigis&lt;/p&gt;
&lt;p&gt;ABB Switzerland&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item></channel></rss>