Hi Jezebel,
will this be applicable only if I have selected some text. My scenario is
that I have a sentence like - "This is brown crow" and my cursor is at the
end of the word crow. Now if I right click at that position, how do I get the
word "crow" or if I place the mouse between the letters "r" and "o" of the
word "crow" and then do a right click, how do I still manage to retrieve the
word "crow".
Word is able to do this. What I would like to know is how it does this? What
does it expose for this functionality?
Thanks.
> Sel.Words(1)
>
[quoted text clipped - 6 lines]
> > It is like similar to what MS Word offers when we right click any word and
> > select "Lookup" from the context menu or use "Spell Check" for it.
Jezebel - 27 Sep 2006 08:59 GMT
Why not try it, rather than guessing?
The code I gave you will select the word containing the selection, even if
the selection is a single point. So if your cursor is within the word crow
(eg between the letters "r" and "o") sel.Words(1) will return "crow". If
your cursor is not within a word then you have to do a little more work,
extending the range either forward or backward: which direction depends on
the logic of what you're doing.
> Hi Jezebel,
>
[quoted text clipped - 26 lines]
>> > and
>> > select "Lookup" from the context menu or use "Spell Check" for it.
Klaus Linke - 30 Sep 2006 03:16 GMT
And regarding the right-click: Put the macro on the context menu for "Text"
(and "Headings" and maybe a few more, like those for tables...), manually
from "Tools > Customize", or through VBA.
Klaus