Get text selection with IAccessible
See the question and my original answer on StackOverflowThe UI automation TextPattern allows you to do this (it's more modern than IAccessible). Check out my answer to this SO question: How to get the word under the cursor in Windows?