如何在功能区中执行commandID? [英] How can I execute a commandID in the Ribbon?

查看:152
本文介绍了如何在功能区中执行commandID?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在旧版本的Office VBA中,我可以创建一个命令栏,对其进行控制,然后执行控件,如下所示:

In old versions of Office VBA I could create a commandbar, put a control on it, and execute the control, like this:

     ;    '使用触发标记的按钮创建一个临时命令栏,用于后续对话框

       设置TempBar = CommandBars.Add(名称:=" FlagDialog")

        '
$
        '将后续命令的标记放在TempBar临时工具栏上。
        Application.CommandBars(" FlagDialog")。Controls.Add Type:= msoControlButton,Id:= 8476,Before:= 1

        '
$
        '点击临时命令栏上的按钮,显示后续对话框的标志。
        Application.CommandBars(" FlagDialog")。Controls(1).Exec

        'Make a temporary commandbar with the button that fires the flag for followup dialog
        Set TempBar = CommandBars.Add(Name:="FlagDialog")
        '
        'Put the flag for followup command onto the TempBar temporary toolbar
        Application.CommandBars("FlagDialog").Controls.Add Type:=msoControlButton, Id:=8476, Before:=1
        '
        'Click the button on the temporary commandbar to display the flag for follow-up dialog
        Application.CommandBars("FlagDialog").Controls(1).Exec

使用功能区,是否有相同的方法来添加commandID并执行它?

Using the Ribbon, is there an equivalent way to add a commandID and execute it?

Mac MVP

推荐答案

嗨Jim,

你是什么意思添加一个commandID?什么是commandID?是 CommandID常量还是

CommandID类
还是其他什么?

What do you mean adding a commandID? What's the commandID? Is it CommandID Constants or CommandID Class or anything others?

最好的问候,

Terry


这篇关于如何在功能区中执行commandID?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆