Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

please help me find "Shared Documents" folder

Status
Not open for further replies.

bereza

Technical User
Jun 14, 2006
105
EU
Hi,

I have been trying to get all files that located at "Shared Documents" at "MySite", I have been working on it and teste many different ways but I have failed everytime.

When I had installed just WSS it was easy and I find them by using following:

SPSite ISite = new SPSite("SPWeb IWebSite = ISite.OpenWeb();
SPFolder IFolder = IWebSite.GetFolder("Shared Documents");
SPFileCollection IFiles = Folder.Files;

but know when i have installed SPS 2003 it is not folder any more (I think) it is a list.

I have tested following but no success.

SPSite IMySite = new SPSite("SPWeb ISite = IMySite.OpenWeb();
SPFolder doc = ISite.Folders["Lists"];

OR

SPListCollection lists = ISite.Lists;
foreach (SPList list in lists)
{
if (list.BaseType == SPBaseType.DocumentLibrary)
.....
}

or another ways, I have failed andgot many expections

Thanks for your help.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top