Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

BasicList Object

Contains information about the basic list type used within the application.

Remarks

The BasicList object allows users to share and categorize information between Web sites.

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

Visual Basic for Applications
Sub ListAllLists()
'Displays the names of all basic lists in the collection

    Dim lstWebList As List
    Dim strName As String
    Dim blnFound As Boolean

    'Set found flag to false
    blnFound = False
    'Check if any lists exist and, if so cycle through them
    If Not ActiveWeb.Lists Is Nothing Then
        For Each lstWebList In ActiveWeb.Lists
            If lstWebList.Type = fpListTypeBasicList Then
                'Set boolean flag to found and names to string
                blnFound = True
                If strName = "" Then
                    strName = lstWebList.Name & vbCr
                Else
                    strName = strName & lstWebList.Name & vbCr
                End If
            End If
        Next
        If blnFound = True Then
            'Display names of all basic lists
            MsgBox "The names of all basic lists in the current Web are:" _
                   & vbCr & strName
        Else
            MsgBox "There are no basic lists in the current Web."
        End If
    Else
        'Otherwise display message to user
        MsgBox "The current Web contains no lists."
    End If

End Sub



Community Additions

ADD
Show:
© 2015 Microsoft