Propriedade OptionButton. GroupName (script de formulários do Outlook)OptionButton.GroupName Property (Outlook Forms Script)

Returns or sets a String that identifies a group of mutually exclusive OptionButton controls.Returns or sets a String that identifies a group of mutually exclusive OptionButton controls. Leitura/gravação.Read/write.

SintaxeSyntax

expressão. Nome_do_grupoexpression.GroupName

expressão Uma variável que representa um objeto OptionButton .expression A variable that represents an OptionButton object.

ComentáriosRemarks

Use o mesmo GroupName para todos os botões no grupo.Use the same GroupName for all buttons in the group. The default setting is an empty string.The default setting is an empty string.

Para criar um grupo de controles OptionButton mutuamente exclusivos, você pode colocar os botões em um quadro no formulário ou pode usar a propriedade GroupName .To create a group of mutually exclusive OptionButton controls, you can put the buttons in a Frame on your form, or you can use the GroupName property. GroupName is more efficient for the following reasons:GroupName is more efficient for the following reasons:

  • You do not have to include a Frame for each group.You do not have to include a Frame for each group. By not using a Frame, you reduce the number of controls on the form, and in turn, improve performance and reduce the size of the form.By not using a Frame, you reduce the number of controls on the form, and in turn, improve performance and reduce the size of the form.

  • You have more design flexibility.You have more design flexibility. If you use a Frame to create the group, all the buttons must be inside the Frame.If you use a Frame to create the group, all the buttons must be inside the Frame. Se quiser mais de um grupo, você deve ter um quadro para cada grupo.If you want more than one group, you must have one Frame for each group. However, if you use GroupName to create the group, the group can include option buttons anywhere on the form.However, if you use GroupName to create the group, the group can include option buttons anywhere on the form. If you want more than one group, specify a unique name for each group; you can still place the individual controls anywhere on the form.If you want more than one group, specify a unique name for each group; you can still place the individual controls anywhere on the form.

  • You can create buttons with transparent backgrounds, which can improve the visual appearance of your form.You can create buttons with transparent backgrounds, which can improve the visual appearance of your form. The Frame is not a transparent control.The Frame is not a transparent control.

Independentemente de qual método você usa para criar o grupo de botões, clicar em um botão em um grupo define todos os outros botões no mesmo grupo como falso.Regardless of which method you use to create the group of buttons, clicking one button in a group sets all other buttons in the same group to False. Todos os botões de opção com o mesmo GroupName em um único contêiner são mutuamente exclusivos.All option buttons with the same GroupName within a single container are mutually exclusive. You can use the same group name in two containers, but doing so creates two groups (one in each container) rather than one group that includes both containers.You can use the same group name in two containers, but doing so creates two groups (one in each container) rather than one group that includes both containers.

For example, assume your form includes some option buttons and a MultiPage that also includes option buttons.For example, assume your form includes some option buttons and a MultiPage that also includes option buttons. The option buttons on the MultiPage are one group and the buttons on the form are another group.The option buttons on the MultiPage are one group and the buttons on the form are another group. The two groups do not affect each other.The two groups do not affect each other. Changing the setting of a button on the MultiPage does not affect the buttons on the form.Changing the setting of a button on the MultiPage does not affect the buttons on the form.

Suporte e comentáriosSupport and feedback

Tem dúvidas ou quer enviar comentários sobre o VBA para Office ou sobre esta documentação?Have questions or feedback about Office VBA or this documentation? 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.Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.