WordLeft, WordLeft()

Syntax

WordLeft [Count,] [Select]

WordLeft([Count,] [Select])

Remarks

The WordLeft statement moves the insertion point or the active end of the selection (the end that moves when you press CTRL+SHIFT+LEFT ARROW (Windows) or COMMAND+SHIFT+LEFT ARROW (Macintosh)) to the left by the specified number of words.

Argument

Explanation

Count

The number of words to move; if less than one or omitted, 1 is assumed.

Select

Specifies whether to select text:

0 (zero) or omitted Text is not selected. If there is already a selection, WordLeft moves the insertion point Count–1 words to the left of the selection.

Nonzero Text is selected. If there is already a selection, WordLeft moves the active end of the selection toward the beginning of the document.

In a typical selection made from left to right, where the active end of the selection is closer to the end of the document, WordLeft shrinks the selection. In a selection made from right to left, it extends the selection.


Note that Word includes spaces following a word as part of the word. However, Word counts punctuation, tab characters, and paragraph marks as "words." For example, if a word is enclosed in quotation marks, moving the insertion point from the position following the closing quotation mark to the position preceding the opening quotation mark using WordLeft would require the instruction WordLeft 3.

The WordLeft() function behaves the same as the statement and also returns the following values.

Value

Explanation

0 (zero)

If the insertion point or the active end of the selection cannot be moved to the left.

–1

If the insertion point or the active end of the selection is moved to the left by any number of words, even if less than Count. For example, WordLeft(10) returns –1 even if the insertion point is only three words from the start of the document.


See Also

CharLeft, SelectCurWord, SentLeft, WordRight