Try something like this:
SPSite site = SPContext.Current.Site;
SPWeb spWeb = site.OpenWeb();
foreach (SPList list in spWeb.lists)
{
if ((!list.Hidden) && (list.BaseType == SPBaseType.DocumentLibrary) && ((int) list.BaseTemplate == 115))
SPList spList = spWeb.Lists[list.Title];
SPDocumentLibrary doclib = (SPDocumentLibrary)spList;
string solutionUrl = SPHttpUtility.UrlPathEncode(spWeb.Url + "/" + doclib.DocumentTemplateUrl, true);
foreach (SPListItem spItem in doclib.Items) //loop through the list items
{//rest of the code}
}//end of SPList foreach loop
Refer this for more info:
Hemendra:Yesterday is just a memory,Tomorrow we may never see
Please remember to mark the replies as answers if they help and unmark them if they provide no help
No comments:
Post a Comment