wp.selectWord

Syntax wp.selectWord ()

Params None required.

Action Causes the word in which the selection is located to become the selection.

Returns True

Examples edit (@examples.testText)

   » true

Place the cursor anywhere in the word "sample" in the first line of the document. Type and execute:
wp.selectWord ()


   » true

The word "sample" is selected.

Notes If the selection extends across multiple words, the last word involved in the selection is selected unless the space following the last word is also selected, in which case the next word becomes the selection.

If the cursor is positioned between words, the word closer to the cursor is selected.

See Also wp.setSelect

wp.getSelect

wp.getSelText

wp.selectParagraph

wp.selectLine

Discuss