<?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: CommandBars object and ObjectWrapper</title><link>https://www.infopathdev.com:443/forums/thread/15201.aspx</link><pubDate>Wed, 28 Mar 2007 07:38:04 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:15201</guid><dc:creator>stzanev</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/15201.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=15201</wfw:commentRss><description>Yes, I am using Reflection to invoke the object. That is actually the problem. Reflection seems not to work outside of the form code. &lt;br /&gt;I will post if I find a solution.&lt;br /&gt;&lt;br /&gt;Stefan</description></item><item><title>Re: CommandBars object and ObjectWrapper</title><link>https://www.infopathdev.com:443/forums/thread/15200.aspx</link><pubDate>Wed, 28 Mar 2007 04:13:38 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:15200</guid><dc:creator>Matt Faus</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/15200.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=15200</wfw:commentRss><description>Hmmm... I just thought of something - could you use reflection?  I've never used reflection and I don't really know much about it, but it seems to be the way to go to get at things not normally exposed.</description></item><item><title>Re: CommandBars object and ObjectWrapper</title><link>https://www.infopathdev.com:443/forums/thread/15199.aspx</link><pubDate>Wed, 28 Mar 2007 04:12:56 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:15199</guid><dc:creator>Matt Faus</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/15199.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=15199</wfw:commentRss><description>Hm, sounds complicated, and you seem fully qualified on your hunt for a workaround!  I have not worked in this scenario too much and I doubt that I could offer any more advice.&lt;br /&gt;&lt;br /&gt;Sorry and good luck! Let us now if you figure it out!</description></item><item><title>Re: CommandBars object and ObjectWrapper</title><link>https://www.infopathdev.com:443/forums/thread/15198.aspx</link><pubDate>Tue, 27 Mar 2007 15:00:28 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:15198</guid><dc:creator>stzanev</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/15198.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=15198</wfw:commentRss><description>Hi Matt, &lt;br /&gt;&lt;br /&gt;Yes I am using the exact same code and using statements.&lt;br /&gt;&lt;br /&gt;Here is the reason I am trying to do this outside of the FormCode:&lt;br /&gt;I have a C# Application that is used to pretty much control InfoPath (switch views, save, open, etc). I need a way to disable the toolbars, so the users only see a window that contains the form. Because, once those toolbars are disabled in a specific FormCode, they remain disabled application-wide, and do not show up when users use InfoPath separately from my application. I want to have a button in my application that will let the users re-enable the toolbars.&lt;br /&gt;&lt;br /&gt;Any suggestions?</description></item><item><title>Re: CommandBars object and ObjectWrapper</title><link>https://www.infopathdev.com:443/forums/thread/15197.aspx</link><pubDate>Sat, 24 Mar 2007 14:54:29 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:15197</guid><dc:creator>Matt Faus</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/15197.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=15197</wfw:commentRss><description>Are you including all of the correct libraries? I would copy all of the using statements from the top of FormCode.cs into this other file to try and use it.&lt;br /&gt;&lt;br /&gt;If all else fails, why can't you just use it from the FormCode.cs file?  We have done some really complicated forms but the most CS files I've ever had on an InfoPath form is 2: FormCode.cs and our home brewed Common.cs.</description></item><item><title>CommandBars object and ObjectWrapper</title><link>https://www.infopathdev.com:443/forums/thread/13092.aspx</link><pubDate>Fri, 23 Mar 2007 16:02:57 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:13092</guid><dc:creator>stzanev</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/13092.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=13092</wfw:commentRss><description>I am again faced with the issue of enabling/disabling InfoPath 2003 toolbars. In the MSDN Technical Article&lt;a target="_blank" href=http://msdn2.microsoft.com/en-us/library/aa192513&gt;http://msdn2.microsoft.com/en-us/library/aa192513&lt;/a&gt;(office.11).aspx there are examples of working with the CommandBars object using ObjectWrapper. Those examples work great from within my FormCode, but whenever I try to use the same technique outside of the managed code I get a InvalidCastException when casting the CommandBar object to the ObjectWrapper.&lt;br /&gt;Does anyone know how to access the CommandBars outside of the FormCode file.</description></item></channel></rss>