Edit the tooltip for toolbarbuttons (Office95 and earlier)

 2000-02-05    Commandbars    0    147

The examples below uses the New-button on the Standard toolbar as an example. You can replace the toolbarnumber with the number or name of another Toolbar, and the number of the button you want to edit.

Use this macro to change the tooltip text on custom or built-in toolbarbuttons:

Sub ChangeToolTip()
' changes the tooltip for a toolbarbutton
    Toolbars(1).ToolbarButtons(1).Name = "My custom tooltip"
End Sub
Use this macro to restore the tooltip text for a built-in toolbarbutton:

Sub ResetToolTip()
' removes a custom tooltip from a toolbarbutton
    Toolbars(1).ToolbarButtons(1).Name = Empty
End Sub
Use this macro to find the index number for the different toolbars:

Sub DisplayToolBarNumber()
' displays number and name to all toolbars
Dim i As Integer
    i = 0
    For i = 1 To Application.Toolbars.Count
        MsgBox Toolbars(i).Name, , "Toolbar " & _
            i & " of " & Application.Toolbars.Count
    Next i
End Sub
NOTE! The toolbar buttons on a toolbar is counted from left to right, extra spaces between the buttons counts as a button too.