gpt4 book ai didi

vba - Excel VBA 对象模型是否允许访问 VBA IDE 菜单项的键盘快捷键?

转载 作者:行者123 更新时间:2023-12-04 21:38:38 24 4
gpt4 key购买 nike

Excel VBA 对象模型是否允许访问 VBA IDE 菜单项的键盘快捷键?
(我想在菜单中创建附加项目并将其与选择的快捷方式连接)

例如,下面的代码返回“C&lear”,这意味着当 VBE IDE 中的“编辑”组处于事件状态时,您可以通过键入“l”访问“清除”项,但您也可以通过单独输入“删除”按钮访问“清除”:

Debug.Print Application.VBE.CommandBars(1).Controls(2).Controls(6).Caption

有没有办法找到 IDE 菜单中项目的实用直接快捷方式(在上述情况下为“删除”)?我想使用新的自定义快捷方式将项目添加到 VBA IDE 菜单?
Debug.Print Application.VBE.CommandBars(1).Controls(3).Controls(6).Caption

返回“&立即窗口”,但您也可以通过直接快捷键“Ctrl+G”访问立即窗口

最佳答案

is there a way to find pragrammaticaly direct shortcut to item in IDE menu ("Delete" in the case above)



就在这里。尝试这个
Debug.Print Application.VBE.CommandBars(1).Controls(2).Controls(6).ShortcutText

这会给你 Del
评论跟进:

enter image description here

关于vba - Excel VBA 对象模型是否允许访问 VBA IDE 菜单项的键盘快捷键?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25766751/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com