none
Why Word SelectionChange not fired when input text? is there any way to capture user input? RRS feed

  • Question

  • I try to capture user input in word document, but the document selection change event don't fire, so I use Keyboard hook to capture user input and try to add contentcontrol to current input word, but the range and selection behavior is abnormal in hook function. is there any suggestion? thanks.
    • Edited by P4ever Wednesday, September 28, 2011 10:52 AM
    Wednesday, September 28, 2011 10:52 AM

Answers

  • If a keyboard hook doesn't work (unfortunately you don't give any details about how it doesn't work), then there's very little else to be done. There are no events that fire when the user types. Selection Change, by design, is triggered only when the mouse or arrow keys and Backspace are used.

    With VBA it's possible to link a keybinding to each possible keystroke, but only with VBA.

     


    Cindy Meister, VSTO/Word MVP
    Wednesday, September 28, 2011 1:05 PM
    Moderator