Geeks With Blogs
John Naguib "It is great to follow up with new technologies but the greater is not to lose you mind or your peace" John Naguib

To Enumerate all items in all document libraries on certain site.

                   SPSite site = new SPSite(http://localhost/home);
                   SPWeb web = site.OpenWeb();
                    foreach (SPList doc in web.Lists) // looping on all libraries on certain site
                    {
                        if (doc.BaseType.ToString()=="DocumentLibrary") // checking that type of the library is Document Library

                       {

                              foreach (SPListItem item in doc.Items) //looping on all items on certain Document Library.
                            {

                                           // use item object to get the data about each item in the Document Library

                             }

                      
                      
}
                                               
                    }

Posted on Wednesday, April 8, 2009 11:51 AM SharePoint | Back to top

Copyright © JohnNaguib | Powered by: GeeksWithBlogs.net