Export (0) Print
Expand All

Application.GetFormTemplateLocation method

Gets the Uniform Resource Locator (URL) or universal naming convention (UNC) location of a form template from the local cache ID.

Namespace:  Microsoft.Office.InfoPath
Assembly:  Microsoft.Office.InfoPath (in Microsoft.Office.InfoPath.dll)

'Declaration
PublicMustOverrideFunctionGetFormTemplateLocation ( _
	cacheIdAsString _
) AsString
'Usage
DiminstanceAsApplicationDimcacheIdAsStringDimreturnValueAsStringreturnValue = instance.GetFormTemplateLocation(cacheId)

Parameters

cacheId
Type: System.String

A string that identifies the form template in the local InfoPath form cache.

Return value

Type: System.String
The URL or UNC for the published location of the form template.

ExceptionCondition
ArgumentNullException

The parameter passed to this method is a null reference (Nothing in Visual Basic).

ArgumentException

The parameter passed to this method is not valid. For example, it is of the wrong type or format.

The value to pass as the cacheID parameter can be identified from the following location in the file system:

%USERPROFILE%\Local Settings\Application Data\Microsoft\InfoPath\FormCache1\foldername\cacheID

Where foldername is a random name assigned in a user's form cache, and cacheID is the name of the folder that contains the cached form template and the cache ID value.

This member can be accessed only by forms opened from a form template that has been configured to run with full trust using the Security and Trust category of the Form Options dialog box. This member requires full trust for the immediate caller and cannot be used by partially trusted code. For more information, see "Using Libraries from Partially Trusted Code" on MSDN.

This type or member can be accessed only from code running in forms opened in Microsoft InfoPath Filler.

In the following example, a cache ID value is passed to the GetFormTemplateLocation method to display the published location of the form template.

MessageBox.Show(Me.Application.GetFormTemplateLocation( _
   "37d5ef02fa44a797$"))

Community Additions

Show:
© 2014 Microsoft