返回 Lists 集合对象,该对象代表当前站点中所有列表的集合。列表可以是 DocumentLibrary 对象、BasicList 对象或 Survey 对象。
expression.Lists
expression 必选。返回“应用于”列表中的对象之一的表达式。
下列示例使用 Web 对象的 Lists 属性返回对 Lists 集合的引用。本示例显示了集合中每个列表的名称。
Sub ViewLists()
'Returns a collection of all lists in the web
Dim objApp As FrontPage.Application
Dim objWeb As WebEx
Dim objlists As Lists
Dim objlist As List
Set objApp = FrontPage.Application
Set objWeb = objApp.ActiveWeb
'Reference the Lists collection
Set objlists = objWeb.Lists
'display the name of each list in the Lists collection
For i = 1 To objlists.Count
MsgBox "The name of the list is " & objlists.Item(i).Name
Next i
End Sub