List 属性

       

返回 List 对象,该对象代表与当前文件夹相关联的列表。

expression.List

expression  必选。返回 WebFolder 对象的表达式。

示例

下列示例返回与活动站点中第二个文件夹相关联的列表对象,并显示了列表中所有域的名称。


Sub ReturnList()
    'Returns the list associated with a folder

    Dim objApp As FrontPage.Application
    Dim objFolder As WebFolder
    Dim objListField As ListField
    Dim objList As List
    Dim strName As String

    Set objApp = FrontPage.Application
    For Each objFolder In objApp.ActiveWeb.AllFolders
        If Not objFolder.List Is Nothing Then
            'Return the List using the List property
            Set objList = objFolder.List
            For Each objListField In objList.Fields

                'Add list names to string
                If strName = "" Then
                    strName = objListField.Name & vbCr
                Else
                    strName = strName & objListField.Name & vbCr
                End If

            Next
            MsgBox "The field names within the" & objList.Name & " list are: " & vbCr & _
            strName
        End If
    Next
End Sub