ListFieldTrueFalse Object

Microsoft FrontPage Visual Basic

ListFieldTrueFalse Object

ListFieldTrueFalse Web

Contains information about the Boolean field in a Microsoft FrontPage list. The ListFieldTrueFalse object allows you to provide the user with a simple, binary user-interface option.

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

Using the ListFieldTrueFalse object

The following example creates a new field of type fpFieldTrueFalse named Default Page. The subroutine displays the name of the new field and the name of the list to which it was added.

Sub CreateTrueFalseField()
'Add new TrueFalse field
    Dim objApp As FrontPage.Application
    Dim objLstFlds As ListFields
    Dim strName As String

    Set objApp = FrontPage.Application
    Set objLstFlds = objApp.ActiveWeb.Lists.Item(0).Fields
    strName = "Default Page"
    'Add new Field of type fpFieldTrueFalse to list
    objLstFlds.Add Name:=strName, Description:="Determines if this is " & _
     "default page", Fieldtype:=fpFieldTrueFalse
    MsgBox "A new field named " & strName & " was added to the list " & _
           objApp.ActiveWeb.Lists.Item(0).Name & "."

End Sub