Application.RegisterFormTemplate Method (String)
Installs the specified form template.
Namespace: Microsoft.Office.InfoPath
Assembly: Microsoft.Office.InfoPath (in Microsoft.Office.InfoPath.dll)
Syntax
'Declaration
Public MustOverride Sub RegisterFormTemplate ( _
formTemplateLocation As String _
)
'Usage
Dim instance As Application
Dim formTemplateLocation As String
instance.RegisterFormTemplate(formTemplateLocation)
public abstract void RegisterFormTemplate(
string formTemplateLocation
)
Parameters
formTemplateLocation
Type: System.StringSpecifies the Uniform Resource Locator (URL) of the form template. This parameter can be specified as a form definition (.xsf) file or a form template (.xsn) file.
Exceptions
Exception | Condition |
---|---|
FileNotFoundException | The form template file cannot be found. |
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. |
Remarks
If the form template has already been registered, the form template's registration record will be overwritten. To control whether a previously registered form template's record is overwritten, use the RegisterFormTemplate(String, String) method instead.
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.
Permissions
-
for reading from the value specified for formTemplateLocation. Associated enumerations: FileIOPermissionAccess.Read
-
for writing to the path where form templates are installed. Associated enumerations: RegistryPermissionAccess.Write
-
for reading and writing to the HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office\InfoPath\SolutionsCatalog key in the registry. Associated enumerations: RegistryPermissionAccess.Read, RegistryPermissionAccess.Write