List Property

Microsoft FrontPage Visual Basic

List Property

Returns a List object that represents the list associated with the specified folder.

expression.List

expression    Required. An expression that returns a WebFolder object.

Example

The following example returns the list object associated with the second folder in the active Web site and displays the names of all fields in the list.

    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