Retrieve word from word doc on mouse right click using Word Automa

K

Kaustav

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.
 
Z

zkid

If you are looking for programming...

I'm not entirely sure if I understand what you need, but this code will
place in a variable whatever word the cursor is abutting (either front or
back) or on:

Dim strWord as String

strWord = Selection.Range.Words(1).

If you're trying to rewrite how your context menu works (right click), then
maybe this code from Excel will give you a head start:
http://exceltips.vitalnews.com/Pages/T0144_Adding_Items_to_a_Context_Menu.html

The cursor remains where it was and the word is not actually selected.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top