新建文档,然后插入带有相关快捷键和菜单设定的 Word 命令表。
expression.ListCommands(ListAllCommands)
expression 必需。该表达式返回一个 Application 对象。
ListAllCommands Boolean 类型,必需。如果属性值为 True,则包括所有的 Word 命令及其设定(不论是自定义的还是内置的)。如果该值为 False,则只包括进行过自定义设定的命令。
本示例将新建文档,该文档将列出所有的 Word 命令及其快捷键和菜单设定,然后打印并关闭新文档,不保存所进行的修改。
Application.ListCommands ListAllCommands:=True
With ActiveDocument
.PrintOut
.Close SaveChanges:=wdDoNotSaveChanges
End With