XmlForm.Template Property

Gets a reference to the FormTemplate object that represents the manifest (.xsf) of the form template associated with the form.

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

Syntax

'Declaration
'Usage

Property Value

A FormTemplate that represents the manifest (.xsf) of the form template associated with the form.

Remarks

The Template property provides access to information about the form definition (.xsf) file (the manifest) of the form template associated with the form, including access to a System.Xml.XPath.XPathNavigator object that can be used to work with the source XML of the .xsf file.

Note

The Template property provides similar functionality to the Solution property of the XDocument object in the COM/Scripting object model, and to the Solution property of the _XDocument2 interface of the InfoPath 2003-compatible managed code object model.

This member can be accessed only by forms running in the same domain as the currently open form, or by forms that have been granted cross-domain permissions.

This type or member can be accessed from code running in forms opened in Microsoft Office InfoPath 2007 or in a Web browser.

Example

In the following example, the Template property of the XmlForm class is used to return a reference to the FormTemplate object. The Manifest property of the FormTemplate object is then used to return a System.Xml.XPath.XPathNavigator object which is used to display the XML contents of the .xsf file in a message box.

MessageBox.Show(this.Template.Manifest.OuterXml.ToString());
MessageBox.Show(Me.Template.Manifest.OuterXml.ToString())

See Also

Reference

XmlForm Class
XmlForm Members
Microsoft.Office.InfoPath Namespace