Capturing keydown event of MS Word using C#

后端 未结 1 1801
[愿得一人]
[愿得一人] 2020-12-11 23:45

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条回答
  • 2020-12-12 00:39

    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.

    0 讨论(0)
提交回复
热议问题