Wednesday, June 17, 2015

Set versioning in Document Library programmatically



SPDocumentLibrary docLib = (SPDocumentLibrary)webDoc.Lists[“Library Name”];
docLib.EnableVersioning = true;
docLib.EnableMinorVersions = false;
docLib.MajorVersionLimit = 2;   // set version limit also
docLib.Update();

No comments:

Post a Comment