ListFieldFile Object

Microsoft FrontPage Visual Basic

ListFieldFile Object

ListFieldFile Web

Contains information about any files contained in the list.

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

Remarks

This field is created automatically by Microsoft FrontPage and cannot be modified by the user.

Using the ListFieldFile object

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

Sub ListFileFields()
'Displays the name of file 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 fpFieldFile
            If objField.Type = fpFieldFile 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