SharePoint / sp-dev-docs

SharePoint & Viva Connections Developer Documentation
https://docs.microsoft.com/en-us/sharepoint/dev/
Creative Commons Attribution 4.0 International
1.25k stars 1.01k forks source link

Missing method #6791

Closed Slogmeister closed 3 years ago

Slogmeister commented 3 years ago

You're missing the "Add" method in this documentation.


Document Details

Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

ghost commented 3 years ago

Thank you for reporting this issue. We will be triaging your incoming issue as soon as possible.

Jerry0527 commented 3 years ago

There is no Add method in SPFolder class, if you want to add SPFolder in specific library, use SPFolderCollection.Add like this:

 using (SPSite site=new SPSite("http://sp/sites/dev/"))

            {
                SPWeb web = site.OpenWeb();
                SPFolderCollection collFolders = web.GetFolder("Shared Documents").SubFolders;
                collFolders.Add("TestFolderForAdd");
            }

Snipaste_2021-03-09_10-01-52

Jerry Zy Microsoft SharePoint Community Support

ghost commented 3 years ago

Issues that have been closed & had no follow-up activity for at least 7 days are automatically locked. Please refer to our wiki for more details, including how to remediate this action if you feel this was done prematurely or in error: Issue List: Our approach to locked issues