Share via


ListFieldTrueFalse Object

SharePoint Designer Developer Reference

Contains information about the Boolean field in a list.

Remarks

The ListFieldTrueFalse object allows you to provide the user with a simple, binary user-interface option.

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

Visual Basic for Applications
Sub CreateTrueFalseField()
'Add new TrueFalse field
    Dim objApp As Application
    Dim objLstFlds As ListFields
    Dim strName As String
    Set objApp = Application
    Set objLstFlds = objApp.ActiveWeb.Lists.Item(0).Fields
    strName = "Default Page"
    'Add new Field of type FieldTypeTrueFalse to list
    objLstFlds.Add Name:=strName, Description:="Determines whether this is " & _
     "default page", Type:=FieldTypeTrueFalse
    MsgBox "A new field named " & strName & " was added to the list " & _
           objApp.ActiveWeb.Lists.Item(0).Name & "."
End Sub

See Also