Group:  Microsoft Word ยป microsoft.public.word.vba.addins
Thread: Get word from word doc on mouse right click

DotNetBag
.NET Development Newsgroups

HTVi
TV Discussion Newsgroups

Our Hot Pick: Rising Antivirus 2006 - Certified by TUV & Checkmark! Get 10% discount by entering this coupon code: ONDISCOUNT10
Rising Antivirus 2006

Get word from word doc on mouse right click
Kaustav 27.09.2006 04:33:03
Hi,

How can I get the word in a MS Word document when we right click the mouse
on it or when the cursor is at the word's end. I am not selecting the word
out here.

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.

Re: Get word from word doc on mouse right click
"Jezebel" <warcrimes[ at ]whitehouse.gov> 27.09.2006 05:24:45
Sel.Words(1)



"Kaustav" <Kaustav[ at ]discussions.microsoft.com> wrote in message
news:DEAE14E1-6E8E-4275-AAE7-A1BBBD5765BF[ at ]microsoft.com...
[Quoted Text]
> Hi,
>
> How can I get the word in a MS Word document when we right click the mouse
> on it or when the cursor is at the word's end. I am not selecting the word
> out here.
>
> 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.
>


Re: Get word from word doc on mouse right click
Kaustav 27.09.2006 07:48:02
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.

"Jezebel" wrote:

[Quoted Text]
> Sel.Words(1)
>
>
>
> "Kaustav" <Kaustav[ at ]discussions.microsoft.com> wrote in message
> news:DEAE14E1-6E8E-4275-AAE7-A1BBBD5765BF[ at ]microsoft.com...
> > Hi,
> >
> > How can I get the word in a MS Word document when we right click the mouse
> > on it or when the cursor is at the word's end. I am not selecting the word
> > out here.
> >
> > 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.
> >
>
>
>
Re: Get word from word doc on mouse right click
"Jezebel" <warcrimes[ at ]whitehouse.gov> 27.09.2006 07:59:45
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.








"Kaustav" <Kaustav[ at ]discussions.microsoft.com> wrote in message
news:7899F138-67F1-431E-86F2-62AEF32CA3AB[ at ]microsoft.com...
[Quoted Text]
> 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.
>
> "Jezebel" wrote:
>
>> Sel.Words(1)
>>
>>
>>
>> "Kaustav" <Kaustav[ at ]discussions.microsoft.com> wrote in message
>> news:DEAE14E1-6E8E-4275-AAE7-A1BBBD5765BF[ at ]microsoft.com...
>> > Hi,
>> >
>> > How can I get the word in a MS Word document when we right click the
>> > mouse
>> > on it or when the cursor is at the word's end. I am not selecting the
>> > word
>> > out here.
>> >
>> > 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.
>> >
>>
>>
>>


Re: Get word from word doc on mouse right click
Klaus Linke 30.09.2006 02:16:02
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


Home | Search | Terms | Imprint | Contact
Newsgroups Reader - provided by WiredBox.Net