CustomizationContext 属性

       

返回或设置一个 TemplateDocument 对象,该对象代表保存着菜单栏、工具栏和组合键的改动的模板或文档。对应于“工具”菜单“自定义”对话框“命令”选项卡上“保存于”框中的值。可读写。

示例

本示例将 Alt+Ctrl+W 添至 FileClose 命令,然后将该键盘自定义方案保存于“Normal”模板中。

CustomizationContext = NormalTemplate
KeyBindings.Add KeyCode:=BuildKeyCode(wdKeyControl, _
    wdKeyAlt, wdKeyW), _
    KeyCategory:=wdKeyCategoryCommand, Command:="FileClose"

本示例向“常用”工具栏中添加“文件版本”按钮。该命令栏自定义方案保存于活动文档所用的模板中。

CustomizationContext = ActiveDocument.AttachedTemplate
Application.CommandBars("Standard").Controls.Add _
    Type:=msoControlButton, _
    ID:=2522, Before:=8