且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

使用C#捕获MS Word中的keydown事件

更新时间:2023-02-07 23:21:16

这看起来像一个重复:的How拿到"&的KeyPress QUOT;从Word 2010加载项事件(在C#开发)?

This looks like a duplicate of: How to get the "KeyPress" event from a Word 2010 Addin (developed in C#)?

在这个问题的这个答案链接在MSDN论坛上一个类似的问题:的 http://social.msdn.microsoft.com/Forums/en-US/vsto/thread/7198a84f-4a37-474b-93b5-1e6f38d5d139 。在对MSDN论坛接受的答案是指出:

In that question this answer links to a similar question on the MSDN forum: http://social.msdn.microsoft.com/Forums/en-US/vsto/thread/7198a84f-4a37-474b-93b5-1e6f38d5d139. In the accepted answer on the MSDN forum it is stated that:

有什么话API或VSTO可以​​拿起按键英寸
没有什么内置的,你可以在一个VSTO项目中使用拿起
键击。

there's nothing in the Word API or VSTO that can pick up keystrokes. There's nothing built-in that you can use in a VSTO project to pick up the keystrokes.

然而,在MSDN论坛上接受的答案还谈到涉及的 WindowSelectionChange 事件 - 它可能是在寻找有用

However, the accepted answer on the MSDN forum also talks about a possible solution involving the WindowSelectionChange event - it might be useful to look in to.