<?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>SharePoint Integration</title><link>https://www.infopathdev.com:443/forums/46.aspx</link><description> For questions concerning issues in the integration of SharePoint and Microsoft InfoPath.</description><dc:language>en</dc:language><generator>CommunityServer 2007 SP3 (Build: 31118.962)</generator><item><title>Get Template Location in Managed Code</title><link>https://www.infopathdev.com:443/forums/thread/67036.aspx</link><pubDate>Wed, 01 Jun 2011 21:29:13 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:67036</guid><dc:creator>miriv365</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/67036.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=46&amp;PostID=67036</wfw:commentRss><description>&lt;p&gt;I have an InfoPath template with managed code written in InfoPath 2007, but targeted to InfoPath 2003 (we have a mixed environment here and it will unfortunately stay a mixed 2003/2007 environment for the forseeable future)&amp;nbsp; In the form I have a button that allows the user to click on it, and it will submit the form, then open a new form based on the same template.&amp;nbsp; However, I am having issues because the URI in the NewFromSolution is hard-coded.&amp;nbsp; I would like to make it more dynamic so that the managed code will know where it&amp;#39;s template is at.&amp;nbsp; This will allow me to make changes to the form without having to modify the hardcoded URI before moving the form to production.&amp;nbsp; &lt;/p&gt;
&lt;p&gt;&amp;nbsp;Does anyone know how to get the information I need?&lt;/p&gt;
&lt;p&gt;This is the current code&amp;nbsp;&lt;/p&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;Me&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;.thisXDocument.Submit()&lt;/font&gt;&lt;font size="2"&gt; 
&lt;p&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;Me&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;.thisApplication.ActiveWindow.Close(&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;True&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;)&lt;/p&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;&lt;font color="#0000ff" size="2"&gt;Me&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;.thisApplication.XDocuments.NewFromSolution(&amp;quot;&lt;/font&gt;&lt;font color="#a31515" size="2"&gt;&lt;font color="#a31515" size="2"&gt;&lt;a href="http://myproductionserver/template.xsn%22)I"&gt;http://MyProductionServer/template.xsn&amp;quot;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt;)&lt;/font&gt;&lt;/a&gt;&lt;/font&gt;&lt;a href="http://myproductionserver/template.xsn%22)I"&gt;&lt;font size="2"&gt; 
&lt;p&gt;I&lt;/a&gt; need to be able to build some kind of string to change the value of &amp;quot;&lt;font color="#a31515" size="2"&gt;&lt;font color="#a31515" size="2"&gt;&lt;a href="http://myproductionserver/template.xsn"&gt;http://MyProductionServer/template.xsn&lt;/a&gt;&amp;quot; to &lt;a href="http://whateverserver/template.xsn"&gt;http://WHATEVERSERVER/template.xsn&lt;/a&gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font color="#a31515"&gt;&lt;/font&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;font color="#a31515"&gt;Any help will be appreciated.&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font color="#a31515"&gt;Thanks&lt;/font&gt;&lt;/p&gt;&lt;/font&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item></channel></rss>