How do you call this code? There is a chance the editor does not have focus at this time. If you run ExecCommandAsync from the click handler of a button the button is stealing focus and prevent the exec command from working.
Thank you, that was it! I was right going to post back what I had found out about this. The problem is that the textarea in the component's DOM loses focus, but the component itself does not, when I click on its toolbar. Thus, handling blur on the component is useless, but I ended up using a keyboard shortcut (via editor's RegisterShortcut method) to toggle a dialog: this way, the focus can be saved before opening the dialog and restored after. This allows me to set some custom colors (programmatically defined) in the control. Still, I am wondering how to keep track of the cursor position (selection) in the textarea, should I want to respond to its movement across a region which was colorized that way; just like the builtin controls do when I move the cursor across a bold section or similar. Do you have any clues about this?