开发者

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

开发者 https://www.devze.com 2022-12-25 09:23 出处:网络
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.

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 tech开发者_StackOverflowniques with sample c# code.

Thanks


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号