如何将宏绑定到 Word 2007 中的按键而不录制新宏?

发布于 2024-07-23 17:25:55 字数 142 浏览 2 评论 0 原文

正如标题雄辩地表达的那样,我需要知道如何(或者是否可能)将宏绑定到 Microsoft Word 2007 中的某个键,而无需每次都记录新的宏。

我发现自己直接在代码中编写新的宏,然后无法将它们绑定到按键。 或者我可能只想将宏重新绑定到另一个键。

As the title so eloquently put it, I need to know how (or if it's even possible) to bind a macro to a key in Microsoft Word 2007 without recording a new macro each time.

I find myself writing new macros directly in code and then not being able to bind them to a key. Or I might just want to rebind a macro to another key.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

还给你自由 2024-07-30 17:25:55

查看 KeysBoundTo 集合 - 请参阅此处BuildKeyCode 方法 - 请参阅此处 以及 此处wdKey 常量列表>

Look at the KeysBoundTo collection - see here, the BuildKeyCode method - see here and the list of wdKey constants here

简单爱 2024-07-30 17:25:55

按照建议,在帮助文件中查找 Word 的 KeyBindings 对象。

此外,如果您的宏必须使用国际键盘,那么这是一个很好的阅读:

As suggested, look up Word's KeyBindings object in the help file.

Additionally, if your macro must work with international keyboards, this is a very good read:

兔小萌 2024-07-30 17:25:55

以下是 Microsoft 的回答: http://office.microsoft.com/video.aspx?assetid=ES010336334&vwidth=884&vheight=540&CTT=11&Origin=

本质上,

1. 单击“办公室”按钮。

  2. 选择“Word 选项”(靠近底部“退出 Word”旁边)。

  3. 选择自定义。

  4a. 如果要将宏添加到按钮,请从“选择命令:”下的下拉列表中选择“宏”。

  4b. 如果您想添加按键绑定,请单击“自定义”(位于左下方,“键盘快捷键:”旁边)。这是与创建新宏时相同的窗口。请务必在选择按键绑定后单击“分配”击键。

Here is an answer from Microsoft: http://office.microsoft.com/video.aspx?assetid=ES010336334&vwidth=884&vheight=540&CTT=11&Origin=

Essentially,

  1. Click the Office Button.

  2. Select Word Options (near the bottom next to Exit Word).

  3. Select Customize.

  4a. If you want to add the macro to a button, select "Macros" from the dropdown under "Choose commands from:".

  4b. If you want to add a keybind, click Customize (at the bottom towards the left, next to "Keyboard shortcuts:". Here is the same window as when you create a new macro. Just be sure to click "Assign" after picking the keystroke.

全部不再 2024-07-30 17:25:55

我想出的最佳解决方案是将一个新的空宏记录到我想要的键(例如 Ctrl+Num 。[小键盘上的 Del 键])并将宏命名为 ctrl_num_dot。 然后我可以从 ctrl_num_dot 子例程调用任何宏。

The best solution I've come up with has been to record a new empty macro to the key I want (say, Ctrl+Num . [the Del key on the numpad]) and name the macro ctrl_num_dot. Then I can call any macro from the ctrl_num_dot subroutine.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文