Table of contents
TOC
Collapse the table of content
Expand the table of content

FileFolderExtensions.CreateDocumentSet Method

SharePoint Dev Documents|Last Updated: 6/19/2017
|
1 Contributor

Creates a new document set as a child of an existing folder, with the specified content type ID.

Namespace:Microsoft.SharePoint.Client
Assembly: OfficeDevPnP.Core.dll

Syntax

public static Folder CreateDocumentSet(this Folder folder, String documentSetName, ContentTypeId contentTypeId)

Parameters

folder

  Type: Microsoft.SharePoint.Client.Folder
  Folder of the document set

documentSetName

  Type: System.String
  Name of the document set

contentTypeId

  Type: Microsoft.SharePoint.Client.ContentTypeId
  Content type of the document set

Return Value

Type: Folder
The created Folder representing the document set, so that additional operations (such as setting properties) can be done.

Remarks

var setContentType = list.BestMatchContentTypeId(BuiltInContentTypeId.DocumentSet);
var set1 = list.RootFolder.CreateDocumentSet("Set 1", setContentType);

See also

© 2018 Microsoft