Share via


List Object

This content is no longer actively maintained. It is provided as is, for anyone who may still be using these technologies, with no warranties or claims of accuracy with regard to the most recent product version or service release.


Aa156207.parchild(en-us,office.10).gifList
Aa156207.space(en-us,office.10).gifAa156207.parchild(en-us,office.10).gif

Contains information about the List object and the Microsoft FrontPage collaboration objects. The List object is a base class that defines the common members used by the different types of lists in FrontPage. For example,  the collaboration objects, — the BasicList, DocumentLibrary, and Survey objects — allow information to be shared and exchanged between different users and different webs. The List object is a member of the Lists collection.

Using the List object

Use Lists.Item(index), where index is either the name of the list or its numeric position within the collection, to return a single List object. The following example displays the names of all lists in the active web. If the web contains no lists, a message is displayed to the user.

  
Sub ListAllLists()
'Displays the names of all lists in the collection

    Dim lstWebList As List
    Dim strName As String

    'Check if any lists exist
    If Not ActiveWeb.Lists Is Nothing Then
        'Cycle through lists
        For Each lstWebList In ActiveWeb.Lists
            'add list names to string
            If strName = "" Then
                strName = lstWebList.Name & vbCr
            Else
                strName = strName & lstWebList.Name & vbCr
            End If
        Next
        'Display names of all lists
        MsgBox "The names of all lists in the current web are:" _
               & vbCr & strName
    Else
        'Otherwise display message to user
        MsgBox "The current web contains no lists."
    End If

End Sub

Similarly, use the WebFolder object's List property to return the List object associated with the folder.

Use the List object's **Fields**property to return a collection of ListField objects that define the fields in the current list.