编程语言
首页 > 编程语言> > 使用C#捕获MS Word的keydown事件

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

作者:互联网

我正在尝试开发Office附加组件,并且需要使用C#捕获MS-Word上的按键事件.有人可以举一个例子说明我该怎么做吗?

解决方法:

看起来像是重复的:How to get the “KeyPress” event from a Word 2010 Addin (developed in C#)?

该问题this answer链接到MSDN论坛上的类似问题:http://social.msdn.microsoft.com/Forums/en-US/vsto/thread/7198a84f-4a37-474b-93b5-1e6f38d5d139.在MSDN论坛上被接受的答案中指出:

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事件的可能解决方案-进行研究可能很有用.

标签:c,vsto,office-interop
来源: https://codeday.me/bug/20191031/1978096.html