Share via


CommandBarButton.Reset Method

Office Developer Reference

Resets a built-in CommandBarButton control to its original function and face.

Aa432776.vs_note(en-us,office.12).gif  Note
The use of CommandBars in some Microsoft Office applications has been superseded by the new Ribbon user interface. For more information, search help for the keyword "Ribbon."

Syntax

expression.Reset

expression   A variable that represents a CommandBarButton object.

Remarks
Resetting a built-in control restores the actions originally intended for the control and resets each of the control's properties back to its original state.

Example
This example customizes a command bar button. First, the button properties are reset to their default state. Then various button properties are set.

Visual Basic for Applications
  Dim cbButton As CommandBarButton
Set cbButton = CommandBars("Custom").Controls(2)
cbButton.Reset
With cbButton
    .BuiltInFace = True 
    .Caption = "Compute Total"
    .DescriptionText = "This button computes the total of all purchases."
    .Enabled = True 
    .TooltipText = "Click to compute total amount for all items in your cart."
End With

See Also