Table of contents
TOC
折叠目录
展开目录

CommandBarButton.FaceId 属性 (办公室)CommandBarButton.FaceId Property (Office)

office 365 dev account|上次更新日期: 2018/3/13
|
2 参与人员

获取或设置CommandBarButton控件的图符的 Id 号。读/写。Gets or sets the Id number for the face of a CommandBarButton control. Read/write.

请注意 已通过 Microsoft Office 流畅的用户界面的新功能区组件取代某些 Microsoft Office 应用程序中的命令栏使用。有关更多信息,请搜索帮助关键字"功能区"。Note The use of CommandBars in some Microsoft Office applications has been superseded by the new ribbon component of the Microsoft Office Fluent user interface. For more information, search Help for the keyword "ribbon."

语法Syntax

表达式其 FaceIdexpression. FaceId

表达式_一个表示CommandBarButton对象的变量。_expression A variable that represents a CommandBarButton object.

注解Remarks

其 FaceId属性决定的外观,不该函数,命令栏按钮。命令栏控件对象的Id属性确定按钮的功能。The FaceId property dictates the look, not the function, of a command bar button. The Id property of the CommandBarControl object determines the function of the button.

对于具有自定义图标的命令栏按钮,其 FaceId属性值为 0 (零)。The value of the FaceId property for a command bar button with a custom face is 0 (zero).

示例Example

本示例添加一个命令栏按钮的自定义命令栏。单击此按钮等效于单击文件菜单上的打开命令,因为 ID 号为 23,而该按钮具有相同的按钮图符与内置的图表按钮。This example adds a command bar button to a custom command bar. Clicking this button is equivalent to clicking the Open command on the File menu because the ID number is 23, yet the button has the same button face as the built-in Charting button.

Set newBar = CommandBars.Add(Name:="Custom2", _ 
     Position:=msoBarTop, Temporary:=True) 
newBar.Visible = True  
Set con = newBar.Controls.Add(Type:=msoControlButton, Id:=23) 
con.FaceId = 17

另请参阅See also

概念Concepts

CommandBarButton 对象CommandBarButton Object

其他资源Other resources

CommandBarButton 对象成员CommandBarButton Object Members

© 2018 Microsoft