返回或设置 Boolean 类型的值,该值确定当前网页在站点导航栏中是否可见。导航栏是用来导航 Web 站点的超链接集。可读写。
expression.InNavBars
expression 必选。返回 NavigationNode 对象的表达式。
如果为 True,则当前网页将出现在导航栏中。如果为 False,则当前网页不会出现在导航栏中。所有 InNavBars 属性设为 False 的网页在“导航”视图中都显示为灰色。
下列示例提示用户选择将要出现在导航栏中的导航节点。如果用户选择“是”,则当前网页将会出现在导航栏中。如果用户选择“否”,则当前网页不会出现在导航栏中,并且在“导航”视图中会显示为灰色。本示例会提示用户对站点中的每个导航节点进行选择。
Sub AllNavigationNodes()
'Return a collection of all navigation nodes used in the current web
'Allows you to select which pages will appear in the navigation bar
Dim objApp As FrontPage.Application
Dim objNavNode As NavigationNode
Dim objNavNodes As NavigationNodes
Dim strAns As String
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
'Prompt the user
strAns = MsgBox("Do you want the page " & objNavNode.Label & _
" to appear in the navigation bar?", vbYesNo)
'If user answers yes, set to True
If strAns = vbYes Then
objNavNode.InNavBars = True
Else
'If no, set to False
objNavNode.InNavBars = False
End If
'Go to next node
Next objNavNode
End Sub