OptionButton object (Outlook Forms Script)

Shows the selection status of one item in a group of choices.

Remarks

Use an OptionButton to show whether a single item in a group is selected. Note that each OptionButton in a Frame is mutually exclusive.

If an OptionButton is bound to a data source, the OptionButton can show the value of that data source as either Yes/No, True/False, or On/Off. If the user selects the OptionButton, the current setting is Yes, True, or On. If the user does not select the OptionButton, the setting is No, False, or Off. For example, an OptionButton in an inventory-tracking application might show whether an item is discontinued. If the OptionButton is bound to a data source, then changing the setting changes the value of that data source. A disabled OptionButton is dimmed and does not show a value.

Depending on the value of the TripleState property, an OptionButton can also have a Null value.

You can also use an OptionButton inside a group box to select one or more of a group of related items. For example, you can create an order form with a list of available items, with an OptionButton preceding each item. The user can select a particular item by checking the corresponding OptionButton OptionButton.

The default property for an OptionButton is the Value property.

Events

Name Description
Click Occurs when the user definitively selects a value for the control that has more than one possible value, or when the value changes to True.

Properties

Name Description
Accelerator Returns or sets the accelerator key for a control. Read/write.
Alignment Returns or sets an Integer that indicates the position of a control relative to its caption. Read/write.
AutoSize Returns or sets a Boolean that specifies whether an object automatically resizes to display its entire contents. Read/write.
BackColor Returns or sets a Long that specifies the background color of the object. Read/write.
BackStyle Returns or sets an Integer that specifies the background style for an object. Read/write.
Caption Returns or sets a String that appears on an object to identify or describe it. Read/write.
Enabled Returns or sets a Boolean that specifies whether a control can receive the focus and respond to user-generated events. Read/write.
ForeColor Returns or sets a Long that specifies the foreground color of an object. Read/write.
GroupName Returns or sets a String that identifies a group of mutually exclusive OptionButton controls. Read/write.
Locked Returns or sets a Boolean that specifies whether a control can be edited. Read/write.
MouseIcon Returns a String that represents the full path name of a custom icon that is to be assigned to the control. Read-only.
MousePointer Returns or sets an Integer that specifies the type of pointer displayed when the user positions the mouse over a particular object. Read/write.
Picture Returns a String that specifies the full path name of a bitmap to display on a control. Read-only.
PicturePosition Returns or sets an Integer that specifies the location of the picture relative to its caption. Read/write.
SpecialEffect Returns or sets an Integer that specifies the visual appearance of an object. Read/write.
TextAlign Returns or sets an Integer that specifies how text is aligned in a control. Read/write.
TripleState Returns or sets a Boolean that determines whether the OptionButton supports the Null state. Read/write.
Value Returns or sets a Variant that specifies whether the option button is selected. Read/write.
WordWrap Returns or sets a Boolean that specifies whether the contents of a control automatically wrap at the end of a line and the control expands to fit the text. Read/write.

Support and feedback

Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.