In my application I select word in document, then I click on button and I want to highlight this word. It works but when I have word followed by comma or dot, for example ' hello, ', in docRange.Text is only character comma (without word 'hello').
What I am doing wrong?
Words doc;
doc=Globals.ThisAddIn.Application.Selection.Words; foreach (Range docRange in doc) { docRange.HighlightColorIndex = WdColorIndex.wdYellow; }