<?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>New Form Different View</title><link>https://www.infopathdev.com:443/forums/thread/53593.aspx</link><pubDate>Mon, 12 Apr 2010 17:46:31 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:53593</guid><dc:creator>Lawson</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/53593.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=53593</wfw:commentRss><description>&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;font size="3" face="Times New Roman"&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="COLOR:teal;FONT-SIZE:10pt;"&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;font size="3"&gt;Does anybody have any suggestions?&lt;span style="FONT-SIZE:10pt;"&gt;&lt;/span&gt;&lt;/font&gt;&lt;/span&gt;&lt;/span&gt;&lt;/font&gt;</description></item></channel></rss>