Click to Rate and Give Feedback
This page is specific to
Microsoft Visual Studio 2005/.NET Framework 2.0

Other versions are also available for the following:
FormTemplate Class (Microsoft.Office.InfoPath)
Represents a form template.

Namespace: Microsoft.Office.InfoPath
Assembly: Microsoft.Office.InfoPath (in microsoft.office.infopath.dll)

Visual Basic (Declaration)
Public MustInherit Class FormTemplate
Visual Basic (Usage)
Dim instance As FormTemplate
C#
public abstract class FormTemplate

The FormTemplate class implements properties for getting information about a form template, including its version number, its cache identifier, the Uniform Resource Identifier (URI) it was loaded from, and an XPathNavigator object positioned at the root of its form definition (.xsf) file. The FormTemplate class also implements a method for opening a file contained within the form template .xsn file.

A FormTemplate object that represents the form template associated with the current form is accessed through the Template property of the XmlForm class.

In the following example, a reference is set to the FormTemplate object for the current form template, then the code displays the values of the Version, CacheId, and Uri properties of the form template.

C#
FormTemplate myTemplate = this.Template;

string templateProperties = "Version: " + myTemplate.Version +
   "\nCacheId: " + myTemplate.CacheId +
   "\nUri: " + myTemplate.Url.ToString();
MessageBox.Show(templateProperties);
Visual Basic
Dim myTemplate As FormTemplate  = Me.Template

Dim templateProperties As String = "Version: " & myTemplate.Version & _
   vbNewLine & "CacheId: " & myTemplate.CacheId & _
   vbNewLine & "Uri: " + myTemplate.Url.ToString()
MessageBox.Show(templateProperties)
System.Object
  Microsoft.Office.InfoPath.FormTemplate
Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
Processing
© 2008 Microsoft Corporation. All rights reserved. Terms of Use  |  Trademarks  |  Privacy Statement
Page view tracker