<?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: Access control properties with script</title><link>https://www.infopathdev.com:443/forums/thread/40297.aspx</link><pubDate>Fri, 03 Apr 2009 17:21:13 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:40297</guid><dc:creator>christian_bahnsen</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/40297.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=40297</wfw:commentRss><description>&lt;p&gt;I agree that there are scenarios where InfoPath appears to be a good tool for a specific job and I&amp;#39;m sorry if the tone of my last post was strident.&amp;nbsp; As a long-time VBA developer I find it frustrating not to have access to familiar tools/methods/properties/events.&amp;nbsp; My frustration level was high when I wrote the post.&amp;nbsp; Since then I&amp;#39;ve been experimenting,&amp;nbsp;trying to accomplish my goals using vbscript and jscript, and am getting close.&amp;nbsp; Thank heaven for Google and forums like this.&amp;nbsp; I find pearls of knowledge hither and yon.&lt;/p&gt;</description></item><item><title>Re: Access control properties with script</title><link>https://www.infopathdev.com:443/forums/thread/40244.aspx</link><pubDate>Thu, 02 Apr 2009 01:33:04 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:40244</guid><dc:creator>Jimmy</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/40244.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=40244</wfw:commentRss><description>&lt;p&gt;I assure you I would not kid in a forum such as this.&lt;/p&gt;
&lt;p&gt;As I said, there is no way to directly interact with a control from the code.&amp;nbsp; An InfoPath form is a visual representation of an XML document, and you can &lt;em&gt;indirectly&lt;/em&gt; interact with controls (get and set values, add and delete rows from repeating sections) by interacting with the form&amp;#39;s XML.&amp;nbsp; Some changes to form controls&amp;#39; visual properties can be accomplished through the use of conditional formatting in a form template&amp;#39;s settings.&lt;/p&gt;
&lt;p&gt;I and many others on this forum have found InfoPath to be quite a handy and versatile tool.&amp;nbsp; I recommend having a poke around this forum to see examples of its uses and capabilities.&lt;/p&gt;</description></item><item><title>Re: Access control properties with script</title><link>https://www.infopathdev.com:443/forums/thread/40239.aspx</link><pubDate>Wed, 01 Apr 2009 21:14:13 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:40239</guid><dc:creator>christian_bahnsen</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/40239.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=40239</wfw:commentRss><description>&lt;p&gt;&lt;strike&gt;&lt;font face="Times New Roman" size="3"&gt;&lt;/font&gt;&lt;/strike&gt;I hope you&amp;#39;re kidding when you say &amp;quot;There isn&amp;#39;t really any way to directly interact with an InfoPath control from within the form&amp;#39;s code.&amp;quot;&lt;/p&gt;
&lt;p&gt;I&amp;#39;m new to InfoPath but an old-timer building applications in Office with VBA.&amp;nbsp; I&amp;#39;ve learned that InfoPath doesn&amp;#39;t support VBA; OK, I can live with that.&amp;nbsp; But if I can&amp;#39;t set properties for controls programmatically or even get a control&amp;#39;s value then I&amp;#39;ve got a problem and maybe InfoPath isn&amp;#39;t as useful a tool as it appeared.&lt;/p&gt;</description></item><item><title>Re: Access control properties with script</title><link>https://www.infopathdev.com:443/forums/thread/39824.aspx</link><pubDate>Mon, 23 Mar 2009 02:30:13 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:39824</guid><dc:creator>Jimmy</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/39824.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=39824</wfw:commentRss><description>&lt;p&gt;As you have surmised, selectSingleNode() returns a reference to an XML node, not a control.&amp;nbsp; There isn&amp;#39;t really any way to directly interact with an InfoPath control from within the form&amp;#39;s code.&lt;/p&gt;
&lt;p&gt;To set the value of a node object (&lt;em&gt;usersControl&lt;/em&gt; in the code you pasted), you can set the &lt;em&gt;text&lt;/em&gt; property.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;usersControl.text = &amp;quot;456&amp;quot;;&lt;/p&gt;&lt;/blockquote&gt;</description></item><item><title>Access control properties with script</title><link>https://www.infopathdev.com:443/forums/thread/39820.aspx</link><pubDate>Sun, 22 Mar 2009 20:37:14 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:39820</guid><dc:creator>Yonatann</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/39820.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=39820</wfw:commentRss><description>&lt;p&gt;Hi,&lt;br /&gt;I&amp;#39;ve created some custom control using C#, i want on form load, via JScript, to pass some data to my control.&lt;br /&gt;However, i can not access any of my control propeties using the script:&lt;br /&gt;&lt;br /&gt;var usersControl = XDocument.DOM.selectSingleNode(&amp;quot;//my:field1&amp;quot;);&lt;br /&gt;usersControl.Value = &amp;quot;456&amp;quot;;&lt;br /&gt;or&lt;br /&gt;usersControl.displayField = &amp;quot;33&amp;quot;;&lt;br /&gt;&lt;br /&gt;Altought those properties are com visible:&lt;br /&gt;[ComVisible(true), Browsable(true)]&lt;br /&gt;public string displayField...&lt;br /&gt;&lt;br /&gt;It seems like the DOM.selectSingleNode returns the control&amp;#39;s data from the form&amp;#39;s XML and not the control instance itself.&lt;br /&gt;&lt;br /&gt;How can I interact with my custom control using script in the form? My main goal is to pass data from web service to my contro.&lt;br /&gt;&lt;br /&gt;Thanks.&lt;font color="#f2f2f2" size="4"&gt;&lt;font color="#f2f2f2" size="4"&gt;&lt;/p&gt;&lt;/font&gt;&lt;/font&gt;</description></item></channel></rss>