Hi,
I have an InfoPath form that is fully-trusted and running in client mode. I need to get the path to the form template files in the cache at runtime, so that I can access some files that were bundled with the template when it was built. The following lines of code were inserted into an on-click event handler for a button on the form:
string cacheID = Application.ActiveWindow.XmlForm.Template.CacheId;
string path = Application.GetFormTemplateLocation(cacheID);
MessageBox.Show(path);
By all indications, this should get the path to the template files in the cache. However, the GetFormTemplateLocation function always returns a null string. I verified the cacheID that I'm passing, for example, "15e47cf421a45cde$" is the cacheID, and the folder
C:\Documents and Settings\User1\Local Settings\Application Data\Microsoft\InfoPath\FormCache2\DF6D4982.118\15e47cf421a45cde$
exists on the machine, and contains all of the template files.
Does anyone have any idea why the GetFormTemplateLocation function is returning a null string?
Thanks.