VBA 禁用/启用快捷键组合
我需要启用和禁用全选“Ctrl + A”的快捷键。
FindKey(BuildKeyCode(wdKeyControl, wdKeyA)).Disable
FindKey(BuildKeyCode(wdKeyControl, wdKeyA)).Rebind wdKeyCategoryCommand, ??
Ctrl + A 的命令参数是什么?
我在任何地方都找不到这个信息!
另外,我只想将它应用于我的模板:
CustomizationContext = ActiveDocument.AttachedTemplate
这似乎不起作用。它似乎适用于普通模板,因为如果我打开任何单词实例,快捷键仍然被禁用。
I need to enable and disable the shortcut key for select all "Ctrl + A".
FindKey(BuildKeyCode(wdKeyControl, wdKeyA)).Disable
FindKey(BuildKeyCode(wdKeyControl, wdKeyA)).Rebind wdKeyCategoryCommand, ??
What is the command parameter for Ctrl + A??
I cannot find this information anywhere!
Also I want to apply it only for my templates:
CustomizationContext = ActiveDocument.AttachedTemplate
This doesn't seem to work. it seems to apply to the normal template because if I open any word instance the shortcut key is still disabled.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
输入
在 VBA 编辑器的立即窗口中
会显示,所以我猜这就是您正在寻找的内容。
对于第二个问题:当您禁用“Ctrl + A”时,您是否检查过
ActiveDocument.AttachedTemplate
不等于NormalTemplate
?Entering
in the Immediate Window of the VBA editor shows
so I guess that is what you are looking for.
To your second question: did you check that
ActiveDocument.AttachedTemplate
is not equal toNormalTemplate
when you disabled "Ctrl + A" ?