ListFieldFile 对象




此域由 Microsoft FrontPage 自动创建,用户不能修改。

使用 ListFieldFile 对象

下列示例显示活动列表中所有类型为 fpFielFile 的域的名称。如果该类型的域不存在,或者站点不包含列表,则向用户显示一条信息。

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
                    '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
            MsgBox "There are no file fields in the list."
        End If
        'Otherwise display message to user
        MsgBox "The current web contains no lists."
    End If
End Sub