WebNavigationBarSets object (Publisher)

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

Remarks

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 a navigation bar is used on the page.

Use the WebNavigationBarSets property of the current document to return a WebNavigationBarSets object.

Use Item (index), where index is the index number, to return a WebNavigationBarSet object from the collection.

Use the Count property to return the number of web navigation bar sets in the collection.

To add the specified web navigation bar to every page of a document, use the Left, Top, and Width parameters of the AddToEveryPage method, where Left is the distance from the left of the page to the left edge of the navigation bar, Top is the distance from the top of the page to the top edge of the navigation bar, and Width is the width of the navigation bar.

Example

The following example sets an object variable to the WebNavigationBarSets collection of the active document.

Dim objWebNavBarSets As WebNavigationBarSets 
Set objWebNavBarSets = ActiveDocument.WebNavigationBarSets

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 by 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 by 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")

This example displays the number of web navigation bar sets in the current document.

MsgBox ActiveDocument.WebNavigationBarSets.Count 


The following example adds the navigation bar named WebNavBarSet1 to every page in the current publication.

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

Methods

Properties

See also

Support and feedback

Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.