将内置 CommandBarButton 控件重置为其原始函数和人脸。
注意
某些 Microsoft Office 应用程序中对 CommandBars 的使用已由 Microsoft Office Fluent 用户界面的新功能区组件取代。 有关详细信息,请参阅 Office Fluent 功能区概述。
语法
表达式。重置
表达 一个代表 CommandBarButton 对象的变量。
备注
重置一个内置控件将恢复该控件原来对应的动作,并将各属性恢复成初始状态。
示例
本示例自定义一个命令栏按钮。 首先,将按钮属性重置为其默认状态。 然后设置各种按钮属性。
Dim cbButton As CommandBarButton
Set cbButton = CommandBars("Custom").Controls(2)
cbButton.Reset
With cbButton
.BuiltInFace = True
.Caption = "Compute Total"
.DescriptionText = "This button computes the total of all purchases."
.Enabled = True
.TooltipText = "Click to compute total amount for all items in your cart."
End With
另请参阅
支持和反馈
有关于 Office VBA 或本文档的疑问或反馈? 请参阅 Office VBA 支持和反馈,获取有关如何接收支持和提供反馈的指南。