查询以获取列表中的所有项目,包括 SharePoint 中子文件夹中的项目 [英] Query to get all items in a list including items in the sub folders in SharePoint

查看:23
本文介绍了查询以获取列表中的所有项目,包括 SharePoint 中子文件夹中的项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个文档库列表.我在该列表中创建了文件夹并将一些文件上传到这些子文件夹.如何使用 SPQuery?

I have a document library list. I created folders in that list and uploaded some files to those sub folders. How to get all these files which are in sub-folders in that document library list using SPQuery?

推荐答案

如果要查询列表或文档库的所有文件夹和子文件夹,则必须定义额外的查询选项.如果您正在使用对象模型,则必须按如下方式设置 SPQuery 对象的 ViewAttributes 属性:

If you want to query all folders and sub folders of a list or document library, you have to define extra query options. If you are working with the object model you have to set the ViewAttributes property of the SPQuery object as follows:

qry.ViewAttributes = "Scope='Recursive'";

qry.ViewAttributes = "Scope='Recursive'";

这篇关于查询以获取列表中的所有项目,包括 SharePoint 中子文件夹中的项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆