This documentation is archived and is not being maintained.

SPFileCollection.Add Method (String, SPTemplateFileType)

Windows SharePoint Services 3

Creates a file in the collection based on the specified URL and template file type.

Namespace:  Microsoft.SharePoint
Assembly:  Microsoft.SharePoint (in Microsoft.SharePoint.dll)

public SPFile Add(
	string urlOfFile,
	SPTemplateFileType templateFileType


Type: System.String
A string that specifies the URL for the file.
Type: Microsoft.SharePoint.SPTemplateFileType
An SPTemplateFileType value that specifies whether the page is a standard SharePoint page or a wiki page.

Return Value

Type: Microsoft.SharePoint.SPFile
An SPFile object that represents the file.