user240282
user240282

Reputation: 127

What is the best way to create a shortcut hook mechanism for Office

I am looking to create shortcut handler for MS Office.
I am creating an addin with VS2010 for Office 2010. The handler needs to listen to all keyboard events when Word/PowerPoint is active.

Although there is a lot of material for creating application level shortcut handlers, I couldn't find one that was specific to Office.

It would be great if somebody could suggest techniques with sample c# code.

Thanks

Upvotes: 2

Views: 1300

Answers (1)

SLaks
SLaks

Reputation: 887449

You need to set a keyboard hook.

Since you're creating an Office addin, you can simply set a normal keyboard hook, which will capture all input in your process.

You can see a C# example here.

Upvotes: 1

Related Questions