<?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: Print from button on form - JScript code - WSH sendkeys</title><link>https://www.infopathdev.com:443/forums/thread/45427.aspx</link><pubDate>Wed, 05 Aug 2009 07:53:41 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:45427</guid><dc:creator>mcmadhan</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/45427.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=45427</wfw:commentRss><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Thanks for replying. I&amp;#39;m new to infopath. Please bare with me&amp;nbsp;for asking too much.&lt;/p&gt;
&lt;p&gt;For the infopath form for which I need this print button now uses C#.net as code behind. &lt;br /&gt;If I have to convert that to JScript. Would you please let me know how to do that?&lt;/p&gt;
&lt;p&gt;Thanks,&lt;br /&gt;M&lt;/p&gt;</description></item><item><title>Re: Print from button on form - JScript code - WSH sendkeys</title><link>https://www.infopathdev.com:443/forums/thread/45396.aspx</link><pubDate>Tue, 04 Aug 2009 15:08:31 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:45396</guid><dc:creator>rcant</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/45396.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=45396</wfw:commentRss><description>&lt;p&gt;&amp;nbsp;for the button you need a onclck event -- substitute your button name for button_name&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;function button_name::OnClick(eventObj)&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;font size="2"&gt;{&lt;br /&gt;&lt;/font&gt;&lt;font size="2" color="#0000ff"&gt;&lt;font size="2" color="#0000ff"&gt;var&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; WshShell = &lt;/font&gt;&lt;font size="2" color="#0000ff"&gt;&lt;font size="2" color="#0000ff"&gt;new&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; ActiveXObject(&lt;/font&gt;&lt;font size="2" color="#800000"&gt;&lt;font size="2" color="#800000"&gt;&amp;quot;WScript.Shell&amp;quot;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;);&lt;br /&gt;WshShell.SendKeys(&lt;/font&gt;&lt;font size="2" color="#800000"&gt;&lt;font size="2" color="#800000"&gt;&amp;quot;^(p)&amp;quot;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;)&lt;br /&gt;}&lt;/font&gt; &lt;br /&gt;&lt;/p&gt;</description></item><item><title>Re: Print from button on form - JScript code - WSH sendkeys</title><link>https://www.infopathdev.com:443/forums/thread/45321.aspx</link><pubDate>Mon, 03 Aug 2009 13:36:29 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:45321</guid><dc:creator>mcmadhan</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/45321.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=45321</wfw:commentRss><description>&lt;p&gt;I&amp;#39;m new to Infopath.&lt;br /&gt;Still don&amp;#39;t have a clue about &amp;quot;how to add the mentioned Jscript in Infopath&amp;quot;.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Mentione JScript&lt;br /&gt;&lt;/strong&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;&lt;br /&gt;function&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; printFormPage() &lt;br /&gt;{&lt;br /&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;var&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;new&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; ActiveXObject(&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;br /&gt;WshShell.SendKeys(&lt;/font&gt;&lt;font color="#800000" size="2"&gt;&lt;font color="#800000" size="2"&gt;&amp;quot;^(p)&amp;quot;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;)&lt;br /&gt;}&lt;br /&gt;&lt;/font&gt;
&lt;p&gt;Would someone help me on that (have print button on infopath form - in browser)?&lt;/p&gt;
&lt;p&gt;Thanks,&lt;br /&gt;M&amp;nbsp;&lt;/p&gt;</description></item><item><title>Re: Print from button on form - JScript code - WSH sendkeys</title><link>https://www.infopathdev.com:443/forums/thread/37078.aspx</link><pubDate>Wed, 14 Jan 2009 16:46:46 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:37078</guid><dc:creator>Patrick Halstead</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/37078.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=37078</wfw:commentRss><description>&lt;p&gt;Yes, thanks to Skarn, we have a very nice jscript security workaround for printing via a button. Cool post!&lt;/p&gt;
&lt;p&gt;JScript is not as secure as C#, however, and there&amp;#39;s a reason that managed code (aka C# and VB.NET) don&amp;#39;t let you do this. So long as you are ok with that, it&amp;#39;s all good! :)&lt;/p&gt;</description></item><item><title>Re: Print from button on form - JScript code - WSH sendkeys</title><link>https://www.infopathdev.com:443/forums/thread/37077.aspx</link><pubDate>Wed, 14 Jan 2009 16:31:38 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:37077</guid><dc:creator>admot</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/37077.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=37077</wfw:commentRss><description>&lt;p&gt;The problem with using &lt;strong&gt;thisXDocument.PrintOut(); &lt;/strong&gt;in jscript is that it didn&amp;#39;t bring up a dialog window. Haven&amp;#39;t tried it in IP2007 and in C#.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;The &amp;quot;WshShell.SendKeys(&amp;quot;^(p)&amp;quot;)&amp;quot; does seem to work. Whata know. I&amp;#39;ve been searching for a clean solution for this for over a year. And here it its. Thanks!&lt;/p&gt;</description></item><item><title>Re: Print from button on form - JScript code - WSH sendkeys</title><link>https://www.infopathdev.com:443/forums/thread/36608.aspx</link><pubDate>Tue, 06 Jan 2009 11:38:01 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:36608</guid><dc:creator>Frederik Van Lierde</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/36608.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=36608</wfw:commentRss><description>&lt;p&gt;If you use InfoPath 2007 + c#&lt;/p&gt;
&lt;p&gt;- Add &lt;strong&gt;button&lt;/strong&gt; to&amp;nbsp;your form&lt;br /&gt;- Open the &lt;strong&gt;properties&lt;/strong&gt; dialog box&lt;br /&gt;- Select &lt;strong&gt;Rules and Custom Code&lt;br /&gt;&lt;/strong&gt;- Click &lt;strong&gt;Edit Form Code&lt;/strong&gt;&amp;nbsp;&lt;br /&gt;- add the following line:&amp;nbsp;&lt;strong&gt;thisXDocument.PrintOut();&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Set the Form Security to &lt;strong&gt;Full Trust&lt;/strong&gt; to make sure PrintOut will work&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item><item><title>Print from button on form - JScript code - WSH sendkeys</title><link>https://www.infopathdev.com:443/forums/thread/36241.aspx</link><pubDate>Wed, 24 Dec 2008 09:57:43 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:36241</guid><dc:creator>Skarn</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/36241.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=36241</wfw:commentRss><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I also ask myself how can I have print button on form? I am limited to level 2 security with my forms so sometimes I try to find ways to do &amp;#39;level 3&amp;#39; security things with level 2 methods.&lt;/p&gt;
&lt;p&gt;Maybe this only works for me but:&lt;/p&gt;
&lt;p&gt;[jScript]&amp;nbsp;&lt;/p&gt;
&lt;p&gt;function printFormPage()&lt;br /&gt;{&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;var WshShell = new ActiveXObject(&amp;quot;WScript.Shell&amp;quot;);&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; WshShell.SendKeys(&amp;quot;^(p)&amp;quot;)&lt;br /&gt;}&lt;/p&gt;
&lt;p&gt;Brings up the print menu! It&amp;#39;s a simple send keys, and you can probably guess I use this to also bring up save as and save boxes too.&lt;/p&gt;
&lt;p&gt;If this works for you, you can possibly do many things.&lt;/p&gt;
&lt;p&gt;Good luck!&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item></channel></rss>