<?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: Open new form with a different view</title><link>https://www.infopathdev.com:443/forums/thread/55933.aspx</link><pubDate>Wed, 16 Jun 2010 18:49:58 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:55933</guid><dc:creator>Jimmy</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/55933.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=55933</wfw:commentRss><description>&lt;p&gt;I&amp;#39;m not quite sure why you&amp;#39;re getting that error, but I did try this and it doesn&amp;#39;t work, because the new form&amp;#39;s view can&amp;#39;t be changed until the event handler finishes executing.&lt;/p&gt;
&lt;p&gt;One thing you can do is the following:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;div&gt;Create a new field in your template called StartingView&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;
&lt;div&gt;Add a Form Open rule that will switch the view to a certain view when StartingView has a certain value&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;
&lt;div&gt;Create a new form from your template with most of the values as their initial values, except set the StartingView field to the special value you selected for step 2.&amp;nbsp; Save this XML file somewhere InfoPath will be able to access it.&lt;/div&gt;&lt;/li&gt;
&lt;li&gt;
&lt;div&gt;Change your code so that it uses the NewFromSolutionWithData, and specify the path to the file saved in step 3 as the first argument.&amp;nbsp; This way, when the new forms are created, they will be loaded with the contents of this XML file as their starting data.&lt;/div&gt;&lt;/li&gt;&lt;/ol&gt;
&lt;p&gt;That should do the trick.&lt;/p&gt;</description></item><item><title>Re: Open new form with a different view</title><link>https://www.infopathdev.com:443/forums/thread/55931.aspx</link><pubDate>Wed, 16 Jun 2010 18:04:23 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:55931</guid><dc:creator>arcad</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/55931.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=55931</wfw:commentRss><description>&lt;p&gt;Did you find any solutions about this problem?&lt;/p&gt;</description></item><item><title>Re: Open new form with a different view</title><link>https://www.infopathdev.com:443/forums/thread/53563.aspx</link><pubDate>Sun, 11 Apr 2010 15:09:31 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:53563</guid><dc:creator>Lawson</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/53563.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=53563</wfw:commentRss><description>&lt;p&gt;&amp;nbsp;I get an error message.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;NewForm method does not exist. &lt;/p&gt;</description></item><item><title>Re: Open new form with a different view</title><link>https://www.infopathdev.com:443/forums/thread/53556.aspx</link><pubDate>Sat, 10 Apr 2010 13:26:20 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:53556</guid><dc:creator>Jimmy</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/53556.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=53556</wfw:commentRss><description>&lt;p&gt;&amp;nbsp;What happens if you use &lt;/p&gt;&lt;blockquote&gt;&lt;p&gt;&amp;nbsp;&lt;font size="2"&gt;NewForm.View.SwitchView(&lt;/font&gt;&lt;font color="#800000" size="2"&gt;&lt;font color="#800000" size="2"&gt;&amp;quot;View 2&amp;quot;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;);&lt;/font&gt;&lt;/p&gt;&lt;/blockquote&gt;</description></item><item><title>Re: Open new form with a different view</title><link>https://www.infopathdev.com:443/forums/thread/53552.aspx</link><pubDate>Sat, 10 Apr 2010 01:32:20 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:53552</guid><dc:creator>Lawson</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/53552.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=53552</wfw:commentRss><description>&lt;p&gt;I am using the following code:&lt;/p&gt;&lt;font color="#008080" size="2"&gt;&lt;font color="#008080" size="2"&gt;&lt;/font&gt;&lt;/font&gt;&lt;font color="#008080" size="2"&gt;&lt;font color="#008080" size="2"&gt;
&lt;p&gt;XDocument&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; NewForm = thisApplication.XDocuments.NewFromSolution(&lt;/font&gt;&lt;font color="#800000" size="2"&gt;&lt;font color="#800000" size="2"&gt;@&amp;quot;C:\Users\Lawson\Desktop\Switch View.xsn&amp;quot;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;);&lt;/p&gt;
&lt;p&gt;thisXDocument.View.SwitchView(&lt;/font&gt;&lt;font color="#800000" size="2"&gt;&lt;font color="#800000" size="2"&gt;&amp;quot;View 2&amp;quot;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;);&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font size="2"&gt;&lt;/font&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;This code opens a new form, but it doesn&amp;#39;t change the view in the new form.&lt;/p&gt;
&lt;p&gt;Does anybody have any suggestions?&lt;font size="2"&gt;&lt;/p&gt;&lt;/font&gt;</description></item><item><title>Open new form with a different view</title><link>https://www.infopathdev.com:443/forums/thread/53548.aspx</link><pubDate>Fri, 09 Apr 2010 22:42:39 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:53548</guid><dc:creator>Lawson</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/53548.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=53548</wfw:commentRss><description>&lt;p style="MARGIN:0in 0in 10pt;" class="MsoNormal"&gt;&lt;font size="3" face="Calibri"&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. Does anybody know how to do this?&lt;/font&gt;&lt;/p&gt;</description></item></channel></rss>