Share via


ListFieldComputed Object

SharePoint Designer Developer Reference

Contains information about fields that the computer automatically creates.

Remarks

The ListFieldComputed object cannot be created by the user and instead is used by Office SharePoint Designer to create a reference from the list to a page in the Web site. For example, in many lists the Title field is created by the computer and is used to reference the page corresponding to the list field.

Use ListFields(Index) to return a ListFieldComputed 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 computed fields in the current list.

Visual Basic for Applications
Sub ListComputedFields()
'Display the names of computed fields in the current list
    Dim objApp As Application
    Dim objField As ListField
    Dim strType As String
    Set objApp = 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
            If objField.Type = FieldTypeComputed Then
                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
        MsgBox "The names of the fields in this list are: " & _
                vbCr & strType
    Else
        'Otherwise display message to user
        MsgBox "The current web site contains no lists."
    End If
End Sub

See Also