Share via


SPDocTemplate Class

The SPDocTemplate class represents a document template used in a document library.

System.Object

   Microsoft.SharePoint.SPDocTemplate

Public Properties

The following table shows the public properties of the SPDocTemplate class, the data type of each property, and a brief description of each.

Name Data Type Description
DefaultTemplate Boolean Gets a Boolean value that indicates whether the template is the default template used when creating document libraries.
Description String Gets the description of the template.
Name String Gets the name of the template.
SchemaXml String Gets the XML schema that defines the template.
Type Int32 Gets the type of the template.

Thread Safety

Any public static (Shared in Visual Basic) members of this type are safe for multithreaded operations. Instance members are not guaranteed to be thread safe.

Remarks

The document template for a library must exist in the Forms folder of the document library.

Example

The following code example iterates through all the document templates of the current site and displays information about each template.

This example requires using directives (Imports in Visual Basic) for the Microsoft.SharePoint, Microsoft.SharePoint.Utilities, and Microsoft.SharePoint.WebControls namespaces.

The example assumes the existence of a .aspx page that contains a label control.

Requirements

Namespace: Microsoft.SharePoint

Platforms: Microsoft Windows Server 2003

Assembly: Windows SharePoint Services (in Microsoft.SharePoint.dll)

Security: Code Access Security