Add(String, String, Microsoft.SharePoint.SPListTemplateType) Method

The Add method of the SPListCollection class creates a list with the specified title, description, and list definition type.

Parameters

strTitle   A string that contains the title.

strDescription   A string that contains the description.

templateType   A Microsoft.SharePoint.SPListTemplateType value that specifies the type of list definition.

Return Value

The GUID for the new list.

Example

The following code example creates a Contacts list in every site within the current site collection.

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

Requirements

Platforms: Microsoft Windows Server 2003

Security: Code Access Security