How to get all document libraries BUT Form Templates, Style, Customized Reports

蓝咒 提交于 2019-12-05 06:50:17

What's wrong with excluding the libraries you don't want in your if?

...
if (!list.Hidden && list.title != "Style Library" && list.title != "Form Templates")
...

You are already selecting the BaseType DocumentLibrary, so you will only receive document libraries, unfortunately form templates is a doclib too, so you will always get it in your selection.

I used this piece of code:

 if (docLib.Hidden || !docLib.AllowDeletion || docLib.IsCatalog || docLib.IsSiteAssetsLibrary || docLib.BaseTemplate == SPListTemplateType.WebPageLibrary)
{
   continue;
}
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!