IsLinkBar 属性

       

返回 Boolean 类型的值,该值表明当前导航节点是否为链接栏。链接栏提供了允许您在当前站点中的网页间导航的超链接。只读。

expression.IsLinkBar

expression  必选。返回 NavigationNode 对象的表达式。

说明

如果为 False,则导航节点不是链接栏。如果为 True,则导航节点是链接栏。

示例

下列示例遍历导航节点层次结构,并显示站点中任何链接栏的名称。如果没有找到链接栏,则向用户显示一条消息。导航节点是否为链接栏是由 IsLinkBar 属性决定的。

Sub DisplayLinkBar()
'Return a collection of all navigation nodes used in the current web
'Searches through the collection and displays the names of all link bars

    Dim objApp As FrontPage.Application
    Dim objNavNode As NavigationNode
    Dim objNavNodes As NavigationNodes
    Dim strAns As String
    Dim blnFound As Boolean

    blnFound = False
    Set objApp = FrontPage.Application
    'Create a reference to the NavigationNodes collection
    Set objNavNodes = objApp.ActiveWeb.AllNavigationNodes
    'For each node in the collection
    For Each objNavNode In objNavNodes
       'If set to True, this is a link bar
       If objNavNode.IsLinkBar = True Then
           MsgBox objNavNode.Label & " is a link bar."
           blnFound = True
       End If
    'Go to next node
    Next objNavNode
    'If no link bars are found, display a message
    If blnFound = False Then
        MsgBox "There are no link bars in the current web."
    End If
End Sub