ListFieldInteger Object

Microsoft FrontPage Visual Basic

ListFieldInteger Object

ListFieldInteger Web

Contains information about fields created automatically by the computer. The ListFieldinteger object cannot be created by the user and instead is used by Microsoft FrontPage to create an ID for each item in the list. For example, in a typical list, the ID field is created by the computer as a unique identifier for each item in the list.

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

Using the ListFieldInteger object

Use ListFields.Item (index) to return a ListFieldInteger object, where index is either the name of the field or its numeric position within the collection. The following example displays the names of all Integer fields in the current list. If the Web site contains no lists, or if the list contains no Integer fields, a message is displayed to the user.

Sub ListIntegerFields()
'Displays the name of Integer fields in the current list

    Dim objApp As FrontPage.Application
    Dim objField As ListField
    Dim strType As String
    Dim blnFound As Boolean

    blnFound = False
    Set objApp = FrontPage.Application
    If Not ActiveWeb.Lists Is Nothing Then
        For Each objField In objApp.ActiveWeb.Lists.Item(0).Fields
            'Check if it is a computed field of type fpFieldInteger
            If objField.Type = fpFieldInteger Then
                blnFound = True
                If strType = "" Then
                    'Create new string
                    strType = objField.Name & vbCr
                Else
                    'Add next field name to string
                    strType = strType & objField.Name & vbCr
                End If
            End If
        Next objField
        If blnFound = True Then
            MsgBox "The names of the fields in this list are: " & _
                    vbCr & strType
        Else
            MsgBox "There are no Integer fields in the list."
        End If
    Else
        'Otherwise display message to user
        MsgBox "The current Web site contains no lists."
    End If
End Sub