WebNavigationBarSets Object (Publisher)

GitHub-Mark-64px

Contribute to this content

Use GitHub to suggest and submit changes.

Last modified: July 28, 2015

A collection of all the WebNavigationBarSet objects in the current document. Each WebNavigationBarSet represents a Web navigation bar set consisting of hyperlinks.

By default there are two WebNavigationBarSet objects on each Web wizard page; one is text-only and the other is vertical. These objects correspond to the design of the wizard regardless of whether or not a navigation bar is used on the page.

Use the WebNavigationBarSets property of the current document to return a WebNavigationBarSet object. The following example sets an object variable to the WebNavigationBarSets collection of the active document.

Dim objWebNavBarSets As WebNavigationBarSets 
Set objWebNavBarSets = ActiveDocument.WebNavigationBarSets

Use WebNavigationBarSets.Item(index), where index is the index number, to return a WebNavigationBarSet object from the collection. The following example returns the first Web navigation bar set from the WebNavigationBarSets collection.

Dim objWebNavBarSet As WebNavigationBarSet 
Set objWebNavBarSet = ActiveDocument.WebNavigationBarSets.Item(1)

The previous example can also be accomplished using WebNavigationBarSets(index), where index is the index number, to return a WebNavigationBarSet object.

Dim objWebNavBarSet As WebNavigationBarSet 
Set objWebNavBarSet = ActiveDocument.WebNavigationBarSets(1)

The previous example can also be accomplished using WebNavigationBarSets(index) where index is a string indicating the name of the Web navigation bar set to return.

Dim objWebNavBarSet As WebNavigationBarSet 
Set objWebNavBarSet = ActiveDocument.WebNavigationBarSets("WebNavBarSet1")

Use WebNavigationBarSets.Count to return the number of Web navigation bar sets in the collection. This example displays the number of Web navigation bar sets in the current document.

MsgBox ActiveDocument.WebNavigationBarSets.Count 

Use WebNavigationBarSets.AddToEveryPage(Left, Top, [Width]), where Left is the distance from the left of the page to the left edge of the navigation bar, Top is the distance form the top of the page to the top edge of the navigation bar, and Width is the width of the navigaion bar, to add the specified navigation bar to every page. The following example adds the navigation bar named "WebNavBar1" to every page in the current publication.

ActiveDocument.WebNavigationBarSets.Item _ 
 ("WebNavBarSet1").AddToEveryPage _ 
 Left:=50, Top:=25
Show:
© 2015 Microsoft