Capturing keydown event of MS Word using C#

ぃ、小莉子 提交于 2019-11-27 08:20:23

问题


I'm trying to develop an office add-on and need to capture the keydown event on MS-Word using C#. can somebody give me an example on how i can do that?


回答1:


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

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:

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.

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.



来源:https://stackoverflow.com/questions/13000645/capturing-keydown-event-of-ms-word-using-c-sharp

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!