<?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>Views</title><link>https://www.infopathdev.com:443/forums/42.aspx</link><description> </description><dc:language>en</dc:language><generator>CommunityServer 2007 SP3 (Build: 31118.962)</generator><item><title>Re: New Form Different View</title><link>https://www.infopathdev.com:443/forums/thread/53783.aspx</link><pubDate>Fri, 16 Apr 2010 16:22:08 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:53783</guid><dc:creator>Hilary Stoupa</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/53783.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=42&amp;PostID=53783</wfw:commentRss><description>&lt;p&gt;Ah, I see by Qazi&amp;#39;s edit that the views aren&amp;#39;t loaded at this point. You have your NewForm variable -- you might want to try adding a field to the form and then, in your code, set the value of the field. Set a rule on the field to switch views -- you can make that rule conditional, only set it when you open from code (thus, it has the value you set in your code), add a rule to clear the field&amp;nbsp;after you switch the view. Not sure if it will work, but might be worth a try!&lt;/p&gt;</description></item><item><title>Re: New Form Different View</title><link>https://www.infopathdev.com:443/forums/thread/53748.aspx</link><pubDate>Thu, 15 Apr 2010 23:23:34 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:53748</guid><dc:creator>Lawson</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/53748.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=42&amp;PostID=53748</wfw:commentRss><description>&lt;p&gt;I get a&amp;nbsp;&amp;quot;COMexception was unhandled by user code&amp;quot;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item><item><title>Re: New Form Different View</title><link>https://www.infopathdev.com:443/forums/thread/53730.aspx</link><pubDate>Thu, 15 Apr 2010 15:22:14 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:53730</guid><dc:creator>Qazi Anis</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/53730.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=42&amp;PostID=53730</wfw:commentRss><description>&lt;p&gt;try &lt;/p&gt;
&lt;p&gt;NewForm.View.SwitchView(&amp;quot;View2&amp;quot;)&lt;/p&gt;
&lt;p&gt;EDIT: It seems views are not loaded uptill this point so can not be changed, however there might be some cool workaround which i dont know&lt;/p&gt;</description></item><item><title>New Form Different View</title><link>https://www.infopathdev.com:443/forums/thread/53728.aspx</link><pubDate>Thu, 15 Apr 2010 14:56:25 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:53728</guid><dc:creator>Lawson</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/53728.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=42&amp;PostID=53728</wfw:commentRss><description>&lt;p&gt;&lt;span style="mso-ascii-font-family:Calibri;mso-hansi-font-family:Calibri;"&gt;&lt;font face="Calibri"&gt;&lt;font size="3"&gt;I have an IP 2003 form with C# code. I would like to add a button that will open up a new form in a different view.&lt;/font&gt;&lt;/font&gt;&lt;/span&gt; &lt;/p&gt;
&lt;p&gt;&lt;font face="Times New Roman" size="3"&gt;I am using the following code:&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font face="Times New Roman"&gt;&lt;span style="FONT-SIZE:10pt;COLOR:teal;"&gt;XDocument&lt;/span&gt;&lt;span style="FONT-SIZE:10pt;"&gt; NewForm = thisApplication.XDocuments.NewFromSolution(&lt;span style="COLOR:maroon;"&gt;@&amp;quot;C:\Users\Lawson\Desktop\Switch View.xsn&amp;quot;&lt;/span&gt;);&lt;/span&gt;&lt;/font&gt;&lt;/p&gt;&lt;font face="Times New Roman"&gt;&lt;span style="FONT-SIZE:10pt;"&gt;
&lt;p&gt;&lt;span style="FONT-SIZE:10pt;"&gt;thisXDocument.View.SwitchView(&lt;span style="COLOR:maroon;"&gt;&amp;quot;View 2&amp;quot;&lt;/span&gt;);&lt;/span&gt;&lt;/p&gt;&lt;span style="FONT-SIZE:10pt;"&gt;
&lt;p&gt;&lt;font size="3"&gt;This code opens a new form, but it doesn&amp;#39;t change the view in the new form.&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font size="3"&gt;Any suggestions?&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font size="3"&gt;Thanks,&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font size="3"&gt;-Lawson&lt;/font&gt;&lt;/p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/font&gt;</description></item></channel></rss>