HorizontalAlignment Property

Microsoft Publisher Visual Basic

Show All Show All

HorizontalAlignment Property

Sets or returns a PbWizardNavBarAlignment constant that represents the horizontal alignment of the buttons in a Web navigation bar set. Read/write.

HorizontalAlignment property can be set to any of these PbWizardNavBarAlignment constants:
pbnbAlignCenter
pbnbAlignLeft
pbnbAlignRight

expression.HorizontalAlignment

expression    Required. An expression that returns a WebNavigationBarSet object.

Remarks

This property is used to set the way that buttons are displayed in a horizontally oriented Web navigation bar set. For example, a WebNavigationBarSet containing 5 links with the HorizontalButtonCount property set to 3 and the HorizontalAlignment property set to right will align the buttons in a grid of 3 columns and 1 row. The first 3 buttons will be in the first row and the remaining 2 buttons will be in the rightmost columns of the second row.

Returns "Access denied" if IsHorizontal = False for the specified WebNavigationBarSet object. Use the ChangeOrientation method to set the orientation of the Web navigation bar set to horizontal first before setting the HorizontalAlignment property.

Example

The following example returns the first Web navigation bar set from the active document, changes the orientation to horizontal if necessary, sets the HorizontalButtonCount property to 3, and then sets the HorizontalAlignment property to pbnbAlignRight.

    With ActiveDocument.WebNavigationBarSets(1)
    If .IsHorizontal = False Then
        .ChangeOrientation pbNavBarOrientHorizontal
    End If
    .HorizontalButtonCount = 3
    .HorizontalAlignment = pbnbAlignRight
End With