BasicList Object


Contains information about the basic list type used within Microsoft FrontPage. The BasicList object allows users to share and categorize information between Web sites.
This object is supported only by Web pages or sites that are based on Microsoft SharePoint Services.
Using the BasicList object
Use Lists.item(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.
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
Use the Lists collection's Add method to create a new list of type fpListTypeBasicList. The following example creates a new list called NewShare.
Sub NewList()
'Adds a new list to the current Web site
Dim objApp As FrontPage.Application
Dim objLists As Lists
Set objApp = FrontPage.Application
Set objLists = objApp.ActiveWeb.Lists
'Add new list and displays a message to the user.
objLists.Add Name:="NewShare", _
ListType:=fpListTypeBasicList, _
Description:="List of Shared files"
MsgBox "A new list was added to the Lists collection."
End Sub