Monday 23 November 2015

SharePoint Hosting Tips: How to Create Folder in SharePoint 2010 Document Library?

Leave a Comment
I have used the following code for folder creation only in document library via list item creation workflow:
SPListItem CurItem = workflowProperties.Item;
SPSite MySite = new SPSite(workflowProperties.WebUrl);
SPWeb Myweb = MySite.OpenWeb();

SPDocumentLibrary spdoclibrary = (SPDocumentLibrary)Myweb.Lists["My Documents"];
Myweb.Folders.Add(workflowProperties.WebUrl + "/My%20Documents/" + CurItem["Title"].ToString());


Another Way:-
SPList splstDoc = Myweb.Lists["My Documents"];
SPFolderCollection folderColl = splstDoc.RootFolder.SubFolders;
SPFolder newFolder = folderColl.Add(workflowProperties.WebUrl + "/My%20Documents/" + CurItem["Title"].ToString());

I have used the following code for file along with properties creation in document library via list item creation workflow
Hashtable objhash = new Hashtable();
byte[] byt = new byte[Convert.ToInt32(FileUpload1.PostedFile.ContentLength)];
objhash.Add("custom field name", "value");
SPFolder myfolder = Myweb.GetList(workflowProperties.WebUrl + "/My%20Documents/").RootFolder;
myfolder.Files.Add("Test.txt", byt, objhash, false);

I even have used the subsequent code for folder along with properties creation in document library via list item creation workflow:
SPFolder myfolder = Myweb.GetFolder(workflowProperties.WebUrl + "/My%20Documents/");
SPFolder spfolder = myfolder.SubFolders.Add(workflowProperties.WebUrl + "/My%20Documents/" + CurItem["Title"].ToString());
spfolder.Item["Title"] = "Aasai";
spfolder.Item["Test"] = "Aasai";

SharePoint Foundation 2010 Hosting Recommendation

Hosted SharePoint Foundation 2010 in Europe is the premiere web-based collaboration and productivity enhancement tool on the market today. With SharePoint 2010 Foundation, you can quickly access and manage documents and information anytime, anywhere though a Web browser in a secure and user friendly way. SharePoint hosting services start at only at €9.99/mo, allowing you to take advantage of the robust feature set for a small business price. offers a variety of hosted SharePoint Foundation 2010 plans as well as dedicated SharePoint 2010Foundation options.

Whether you work with people across the office or across continents, hosted SharePoint Foundation 2010 allows you and your team members to share schedules, compare notes and collaborate on virtually any type of file

In addition to the free domain name, this hosting provider guarantees 30 days prorated money back to enable their customers to ask for a prorated refund if cancelling within the first 30 days, which ensures customers can put their money in safe. Besides, this company accepts both credit cards and PayPal. Therefore, the purchase is convenient and secure.

When coming across hosting issues, customers are able to contact the support team and get instant and effective assistance by email support and write down the details of the problems to get the right and professional answers to deal with their problems. What’s more, in the knowledgebase, technical staffs have worked out a pile of in-depth articles with a lot of information about hosting, designed to assist customers to deal with common issues independently.


Post a Comment