Evento OptionButton.Click (Script do Outlook Forms)

Ocorre quando o usuário seleciona definitivamente um valor para o controle que tem mais de um valor possível ou quando o valor é alterado para True.

Sintaxe

expressão. Clique

Expressão Uma variável que representa um objeto OptionButton .

Comentários

The following are examples of actions that initiate the Click event of the specified control:

  • Clicking a blank area of a form or a disabled control (other than a list box) on the form.

  • Clicking a control with the left mouse button (left-clicking).

  • Pressing a control's accelerator key.

For some controls, the Click event occurs when the Value property changes. However, using the PropertyChange or CustomPropertyChange event is the preferred technique for detecting a new value for a property. The following are examples of actions that initiate the Click event due to assigning a new value to a control: changing the value of an OptionButton to True, and setting one OptionButton in a group to True sets all other buttons in the group to False, but the Click event occurs only for the button whose value changes to True.

The Click event is not initiated when Value is set to Null.

Left-clicking changes the value of a control, thus it initiates the Click event. Right-clicking does not change the value of the control, so it does not initiate the Click event.

If you bind an OptionButton to a field, then the Click event does not fire. You need to use the PropertyChange or CustomPropertyChange event to detect the change via code, as in the following code sample:

Sub Item_PropertyChange(ByVal Name) 
Set MyListBox = Item.GetInspector.ModifiedFormPages("Message").Controls("OptionButton1") 
Select Case Name 
    Case "Mileage" 
        Item.CC = MyOptionButton.Value 
        Item.Subject = MyOptionButton.Value 
    Case Else 
End Select 
End Sub

Suporte e comentários

Tem dúvidas ou quer enviar comentários sobre o VBA para Office ou sobre esta documentação? Confira Suporte e comentários sobre o VBA para Office a fim de obter orientação sobre as maneiras pelas quais você pode receber suporte e fornecer comentários.