Microsoft Word: How to get a selected word when you do a right click
One of the widely spread tasks in word is to get the current word for processing it further. For example, you typed a single word and what to do some actions against it, or search in the dictionary (database) for such entries. I.e. do whatever you need. When you do the right click on the word you may see the context menu with the Synonyms entry: Do you look for a similar implementation? If so, this article will give you a good start! The Word object model provides the Selection class. Unfortunately it doesn't provide any information about the currently selected word, i.e. where exactly the user did the right click. As one of the possible ways, to get the job done you may use the MoveStart* and MoveEnd* methods of the Selection class. I included asterisks intentionally to draw your attention to the fact that you may find other methods / variations useful. So here I will give you the basics. The MoveStartUntil method of the Selection class moves the start position...