Top Property

Microsoft Office Visual Basic

Sets or returns the distance (in points) from the top of the Office Assistant, or from the top edge of the specified command bar, to the top edge of the screen. For docked command bars, this property returns or sets the distance from the command bar to the top of the docking area. Read/write Long.

expression.Top

expression    Required. An expression that returns one of the above objects.

ShowTop property as it applies to the CommandBarButton, CommandBarComboBox, CommandBarControl, and CommandBarPopup objects.

Returns the distance (in pixels) from the top edge of the specified command bar control to the top edge of the screen. Read-only Long.

expression.Top

expression    Required. An expression that returns one of the above objects.

Example

ShowAs it applies to the Assistant and CommandBar objects.

This example moves the Office Assistant to another coordinate and sets its Top property for subsequent appearances.

With Assistant
    .On = True
    .Visible = True
    .Sounds = True
    .Animation = msoAnimationBeginSpeaking
End With
Assistant.Top = 100
MsgBox "Click OK to move the Assistant to a " & _
         "new location."
Assistant.Top = 500
				

This example positions the upper-left corner of the floating command bar named Custom 140 pixels from the left edge of the screen and 100 pixels from the top of the screen.

Set myBar = CommandBars("Custom")
myBar.Position = msoBarFloating
With myBar
    .Left = 140
    .Top = 100
End With