SentLeft, SentLeft()

Syntax

SentLeft [Count,] [Select]

SentLeft([Count,] [Select])

Remarks

The SentLeft statement moves the insertion point or the active end of the selection (the end that moves when you press SHIFT+an arrow key) to the left by the specified number of sentences.

Argument

Explanation

Count

The number of sentences 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, SentLeft moves the insertion point Count–1 sentences to the left of the selection.

Nonzero Text is selected. If there is already a selection, SentLeft 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, SentLeft shrinks the selection. In a selection made from right to left, it extends the selection.


Note that Word counts empty table cells as "sentences," and that, regardless of length or punctuation, Word considers every paragraph to contain at least one sentence.

The SentLeft() 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 sentences, even if less than Count. For example, SentLeft(10) returns –1 even if the insertion point is only three sentences from the start of the document.


Example

This example deletes all sentences in the document containing the phrase "see page." In other words, the example deletes all cross-references to other pages. Note that you could substitute SelectCurSentence for the pair of instructions SentLeft and SentRight 1, 1.


StartOfDocument
EditFind .Find = "see page", .WholeWord = 1, .Direction = 0, .Format = 0
While EditFindFound()
    SentLeft
    SentRight 1, 1
    EditClear
    EditFind .Find = "see page", .WholeWord = 1, .Direction = 0, \
        .Format = 0
Wend

See Also

CharLeft, ParaUp, SelectCurSentence, SentRight, StartOfLine, WordLeft