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?
Asked
Active
Viewed 3,691 times
4
-
1Some own initiative is also appreciated. – Styxxy Oct 21 '12 at 18:27
-
@styxxy, Yes but most of the tutorials i found focus on adding content and/or controls to a document. – yohannist Oct 21 '12 at 18:32
1 Answers
5
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.

Community
- 1
- 1

Lasse Christiansen
- 10,205
- 7
- 50
- 79