Applies To
Button Object, Buttons Collection, CheckBox Object, DrawingObjects Collection, GroupBox Object, GroupBoxes Collection, Label Object, Labels Collection, OptionButton Object, OptionButtons Collection.
Description
Returns or sets the keyboard accelerator character for the control. Read-write.
Remarks
Each control has one accelerator character which the user can press in combination with the ALT key to activate a control while a dialog is running.
The first text character of the control that matches the first accelerator text character will be underlined. The comparison for underlining is case-sensitive, but case is not considered when a key is pressed.
On the Apple Macintosh, the accelerator character is only underlined when the CommandUnderlines property is True. If this property is False, the accelerator character is preserved, but it is not underlined.
If the accelerator key doesn't match any text in the control, the accelerator is nonfunctional.
Example
This example sets the button text and accelerator key for button two on Dialog1.
With DialogSheets("Dialog1").Buttons(2) .Text = "Press Me" .Accelerator = "P" End With