问题
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