Word VSTO override CTRL+Z / CTRL+Y

偶尔善良 提交于 2019-12-07 11:14:45

问题


I'm looking for a way to override Undo (CtrlZ) / Redo (CtrlZ) commands in Word 2010 (C# + VSTO). Is it possible ?

I managed to catch Copy / Paste commands, but it seems that Undo / Redo are not commands in RibbonUI like Copy / Paste.


回答1:


If you want some control over what happens with Undo/Redo, check out Microsoft.Office.Interop.Word.UndoRecord. Here's the thread where I learnt to use it properly!

If you want to catch the actual keystrokes, then you're in Windows API land. So generally, Google terms related to that. But message-hooks-in-add-ins may be useful to you.



来源:https://stackoverflow.com/questions/11761633/word-vsto-override-ctrlz-ctrly

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