Share via


ListFieldFile Object

SharePoint Designer Developer Reference

Contains information about any files contained in the list.

Remarks

This field is created automatically by Office SharePoint Designer and cannot be modified by the user.

The following example displays the names of all fields of type FieldTypeFile in the first list. If no fields of this type exist, or if the Web site contains no lists, a message is displayed to the user.

Visual Basic for Applications
Sub ListFileFields()
'Displays the name of file fields in the current list
    Dim objApp As Application
    Dim objField As ListField
    Dim strType As String
    Dim blnFound As Boolean
    blnFound = False
    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 of type FieldTypeFile
            If objField.Type = FieldTypeFile 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 file fields in the list."
        End If
    Else
        'Otherwise display message to user
        MsgBox "The current web contains no lists."
    End If
End Sub

See Also