CommandChecked 事件

       

当指定的 Microsoft Office Web 组件确定指定的命令是否被选中时,该事件发生。

Private Sub Form_CommandChecked(ByVal Command As Variant, ByVal Checked As Object)

Command   已经确认被选中的命令。

Checked   将该对象的 Value 属性设为 False,会取消对命令的选定。

说明

OCCommandIdChartCommandIdEnumPivotCommandId 常量包含每个 Web 组件受支持的命令的列表。

示例

下面的示例显示了捕获 CommandChecked 事件的子例程的语法。

Private Sub Form_CommandChecked( _
        ByVal Command As Variant, ByVal Checked As Object)
    Dim intResponse As Integer
    Dim strPrompt As String

    strPrompt = "Uncheck the command?"

    intResponse = MsgBox(strPrompt, vbYesNo)

    If intResponse = vbYes Then
        Checked.Value = False
    Else
        Checked.Value = True
    End If
End Sub