目录

Checked 属性

优质
小牛编辑
121浏览
2023-12-01

本主题中的某些内容可能不适用于某些语言。

如果“Office 助手”气球中的指定复选框被选中,则返回TrueBoolean 类型,可读写。

示例

本示例创建一个带标题、文字和三个区域选项的气球。当用户单击该气球中的“确定”按钮时,就会打印出所选区域中的数据。

With Assistant.NewBalloon
 .Heading = "Regional Sales Data"
 .Text = "Select the region(s) you want to print."
 For i = 1 To 3
 .CheckBoxes(i).Text = "Region " & i
 Next
 .Button = msoButtonSetOkCancel
 If .Show = msoBalloonButtonOK Then
 dataPrinted = 0
 For i = 1 To 3
 If .CheckBoxes(i).Checked = True Then
 ' Code to print region data.
 dataPrinted = dataPrinted + 1
 MsgBox "Region " & i & " data printed."
 End If
 Next
 If dataPrinted = 0 Then MsgBox "No data printed."
 End If
End With