全部显示

Caption 属性

       

返回或设置指定命令栏控件的题注文字。String 类型,可读写。

注意   控件的题注也可作为默认的“屏幕提示”显示。

示例

本示例可实现的功能为:在自定义命令栏中添加一个带拼写检查按钮图符的命令栏控件,然后将其题注设置为“Spelling checker”。

Set myBar = CommandBars.Add(Name:="Custom", _
Position:=msoBarTop, Temporary:=True)
myBar.Visible = True
Set myControl = myBar.Controls _
.Add(Type:=msoControlButton, Id:=2)
With myControl
    .DescriptionText = "Starts the spelling checker"
    .Caption = "Spelling checker"
End With