using Microsoft.SharePoint.Client;using Microsoft.SharePoint.Client.DocumentSet;
using Microsoft.SharePoint.Client;
Microsoft.SharePoint.Client.dll;Microsoft.SharePoint.Client.RunTime.dll;Microsoft.SharePoint.Client.DocumentManagement.dll;
Microsoft.SharePoint.Client.dll;
Microsoft.SharePoint.Client.RunTime.dll;
using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Threading.Tasks;using Microsoft.SharePoint.Client;using Microsoft.SharePoint.Client.DocumentSet;namespace CSOMSamples{ class Program { static void Main(string[] args) { //// String Variable to store the siteURL string siteURL = "http://c4968397007/"; //// String Variable to store the document set name string dsName = "Vijai Documents"; //// Get the context for the SharePoint Site to access the data ClientContext clientContext = new ClientContext(siteURL); //// Get the document library in which the document set has to be created List list = clientContext.Web.Lists.GetByTitle("Documents"); //// Get the parent folder where the document set has to be created Folder parentFolder = list.RootFolder; //// Get the "Document Set" content type by id (Document Set content type Id : 0x0120D520) for the document library ContentType ct = clientContext.Web.ContentTypes.GetById("0x0120D520"); clientContext.Load(ct); clientContext.ExecuteQuery(); //// Create a new document set //// A new document set will be created in "Documents" library as "Vijai Documents" under which you can add the documents DocumentSet.Create(clientContext, parentFolder, dsName, ct.Id); clientContext.ExecuteQuery(); } }}
You need to be a premium member to use this feature. To access it, you'll have to upgrade your membership.
Become a sharper developer and jumpstart your career.
$0
$
. 00
monthly
For Basic members:
$20
For Premium members:
$45
For Elite members: