Share via


List Object

Multiple objects
Lists
List
Multiple objects

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, Discussion, DocumentLibrary, and Survey objects — allow information to be shared and exchanged between different users and different web sites. The List object is a member of the Lists collection.

This object is supported only by Web pages or sites that are based on Microsoft SharePoint Services.

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 site. If the Web site 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.

Properties | AllowAttachments Property | AllowModerate Property | Application Property | DefaultViewPage Property | Description Property | DesignSecurity Property | DisplayForm Property | EditForm Property | Fields Property | Folder Property | IsHidden Property | IsModified Property | Name Property | NewForm Property | Parent Property | ReadOnly Property | Type Property | ViewPages Property | Web Property

Methods | ApplyChanges Method

Parent Objects | Web | WebEx

Child Objects | ListFields | Web | WebFolder