ListFieldComputed 对象

         
ListFieldComputed

包含关于由计算机自动创建的域的信息。用户不能创建 ListFieldComputed 对象,而是由 Microsoft FrontPage 用该对象创建从列表到站点中网页的引用。例如,在许多列表中,Title 域由计算机创建,用来引用与列表域对应的网页。

使用 ListFieldComputed 对象

使用 ListFields.Item(index) 可以返回 ListFieldComputed 对象,其中 index 是域的名称或其在集合中的位置(用数字表示)。下列示例显示当前列表所有计算过的域的名称。

Sub ListComputedFields()
'Display the names of computed fields in the current list

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

    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
            If objField.Type = fpFieldComputed 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 contains no lists."
    End If
End Sub