CREATEFOLDER

Used to create a folder in a document library.

Syntax

CREATEFOLDER(string listName, string folder, [boolean recursive = false]);

Example: to create folder Images in document library Shared Documents:

CALL CREATEFOLDER('Shared Documents', 'Images');

It is also possible to create subfolders of existing folders.

Example: to create subfolder Logos under folder Images in document library Shared Documents:

CALL CREATEFOLDER('Shared Documents', 'Images/Logos');

By default all parent folders must exist when creating subfolders. Use the recursive parameter to create all subfolders recursively.

Example: to create subfolder a/b/c/d recursively in document library Shared Documents:

CALL CREATEFOLDER('Shared Documents', 'a/b/c/d', true);

Code examples

Create folder

using (var connection = new SharePointConnection(connectionString))
{
    connection.Open();
    using (var command = new SharePointCommand(@"CALL CREATEFOLDER('Shared Documents', 'Images')", connection))
    {
        command.ExecuteNonQuery();
        Console.WriteLine("ID = " + command.LastInsertedId);
    }
}

Code result

ID = 4


Skip Navigation Links.

Visa     MasterCard