<?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: Getting form template location at runtime</title><link>https://www.infopathdev.com:443/forums/thread/33263.aspx</link><pubDate>Mon, 20 Oct 2008 15:22:52 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:33263</guid><dc:creator>sturge</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/33263.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=33263</wfw:commentRss><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;The code you suggested is the same as the code I already tried (check my intial post again).&amp;nbsp; And the first thing I did was look up GetFormTemplateLocation on MSDN, to no avail.&lt;/p&gt;</description></item><item><title>Re: Getting form template location at runtime</title><link>https://www.infopathdev.com:443/forums/thread/33239.aspx</link><pubDate>Sat, 18 Oct 2008 05:43:01 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:33239</guid><dc:creator>swathip</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/33239.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=33239</wfw:commentRss><description>&lt;span style="FONT-SIZE:10pt;COLOR:black;LINE-HEIGHT:115%;FONT-FAMILY:&amp;#39;Verdana&amp;#39;,&amp;#39;sans-serif&amp;#39;;mso-bidi-font-family:&amp;#39;Courier New&amp;#39;;mso-themecolor:text1;mso-no-proof:yes;"&gt;Hi,&lt;/span&gt;&lt;span style="FONT-SIZE:10pt;COLOR:black;LINE-HEIGHT:115%;FONT-FAMILY:&amp;#39;Verdana&amp;#39;,&amp;#39;sans-serif&amp;#39;;mso-bidi-font-family:&amp;#39;Courier New&amp;#39;;mso-themecolor:text1;mso-no-proof:yes;"&gt;Use the following code.&lt;/span&gt;&lt;span style="FONT-SIZE:10pt;COLOR:black;LINE-HEIGHT:115%;FONT-FAMILY:&amp;#39;Verdana&amp;#39;,&amp;#39;sans-serif&amp;#39;;mso-bidi-font-family:&amp;#39;Times New Roman&amp;#39;;mso-themecolor:text1;mso-fareast-font-family:&amp;#39;Times New Roman&amp;#39;;"&gt;string cacheID = this.Application.ActiveWindow.XmlForm.Template.CacheId; &lt;/span&gt;&lt;span style="FONT-SIZE:10pt;COLOR:black;FONT-FAMILY:&amp;#39;Verdana&amp;#39;,&amp;#39;sans-serif&amp;#39;;mso-bidi-font-family:&amp;#39;Times New Roman&amp;#39;;mso-themecolor:text1;mso-fareast-font-family:&amp;#39;Times New Roman&amp;#39;;"&gt;string path = this.Application.GetFormTemplateLocation(cacheID);&lt;/span&gt;&lt;span style="FONT-SIZE:10pt;COLOR:black;FONT-FAMILY:&amp;#39;Verdana&amp;#39;,&amp;#39;sans-serif&amp;#39;;mso-bidi-font-family:&amp;#39;Times New Roman&amp;#39;;mso-themecolor:text1;mso-fareast-font-family:&amp;#39;Times New Roman&amp;#39;;"&gt;MessageBox.Show(path);&lt;/span&gt;&lt;span style="FONT-SIZE:10pt;COLOR:black;FONT-FAMILY:&amp;#39;Verdana&amp;#39;,&amp;#39;sans-serif&amp;#39;;mso-bidi-font-family:&amp;#39;Times New Roman&amp;#39;;mso-themecolor:text1;mso-fareast-font-family:&amp;#39;Times New Roman&amp;#39;;"&gt;Also go through the following link.&lt;/span&gt;&lt;span style="FONT-SIZE:10pt;COLOR:black;FONT-FAMILY:&amp;#39;Verdana&amp;#39;,&amp;#39;sans-serif&amp;#39;;mso-bidi-font-family:&amp;#39;Times New Roman&amp;#39;;mso-themecolor:text1;mso-fareast-font-family:&amp;#39;Times New Roman&amp;#39;;"&gt;&lt;a href="http://msdn.microsoft.com/en-us/library/microsoft.office.infopath.application.getformtemplatelocation(VS.80).aspx"&gt;http://msdn.microsoft.com/en-us/library/microsoft.office.infopath.application.getformtemplatelocation(VS.80).aspx&lt;/a&gt;&lt;/span&gt;&lt;span style="FONT-SIZE:10pt;COLOR:black;LINE-HEIGHT:115%;FONT-FAMILY:&amp;#39;Verdana&amp;#39;,&amp;#39;sans-serif&amp;#39;;mso-themecolor:text1;"&gt;&amp;nbsp;&lt;/span&gt;</description></item><item><title>Getting form template location at runtime</title><link>https://www.infopathdev.com:443/forums/thread/33215.aspx</link><pubDate>Fri, 17 Oct 2008 16:09:22 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:33215</guid><dc:creator>sturge</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/33215.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=33215</wfw:commentRss><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I have an InfoPath form that is fully-trusted and running in client mode.&amp;nbsp; I need to get the path to the&amp;nbsp;form template files in the cache at runtime, so that I can access&amp;nbsp;some files that were bundled with the template when it was built.&amp;nbsp; The following lines of code were inserted into an on-click event handler for a button on the form:&lt;/p&gt;&lt;font color="#0000ff" size="2"&gt;string&lt;/font&gt;&lt;font size="2"&gt; cacheID = Application.ActiveWindow.XmlForm.Template.CacheId;&lt;/font&gt;&lt;/font&gt;&lt;font size="2"&gt; 
&lt;p&gt;&lt;/font&gt;&lt;font color="#0000ff" size="2"&gt;string&lt;/font&gt;&lt;font size="2"&gt; path = Application.GetFormTemplateLocation(cacheID);&lt;/p&gt;
&lt;p&gt;&lt;/font&gt;&lt;font color="#2b91af" size="2"&gt;MessageBox&lt;/font&gt;&lt;font size="2"&gt;.Show(path);&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font size="2"&gt;By all indications, this should get the path to the template files in the cache.&amp;nbsp; However, the GetFormTemplateLocation function always returns a null string.&amp;nbsp; I verified the cacheID that I&amp;#39;m passing, for example, &amp;quot;15e47cf421a45cde$&amp;quot; is the cacheID, and the folder &lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font size="2"&gt;C:\Documents and Settings\User1\Local Settings\Application Data\Microsoft\InfoPath\FormCache2\DF6D4982.118\15e47cf421a45cde$&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font size="2"&gt;exists on the machine, and contains all of the template files.&amp;nbsp;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font size="2"&gt;Does anyone have any idea why the GetFormTemplateLocation function is returning a null string?&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;&lt;font size="2"&gt;Thanks.&lt;/font&gt;&lt;font size="2"&gt;&lt;/p&gt;&lt;/font&gt;</description></item></channel></rss>