StartOfLine, StartOfLine()

Syntax

StartOfLine [Select]

StartOfLine ([Select])

Remarks

The StartOfLine statement moves the insertion point or, if Select is nonzero, the active end of the selection (the end that moves when you press SHIFT+HOME) to the beginning of the current line or the line that contains the active end of the selection.

The StartOfLine() function behaves the same as the statement and also returns one of the following values.

Value

Explanation

0 (zero)

If the insertion point or the active end of the selection was not moved (that is, if it was already at the beginning of the line)

–1

If the insertion point or the active end of the selection was moved


Avoid using StartOfLine by itself to go to the beginning of a paragraph unless you are sure that the paragraph is a single line (for example, a word in a list of words).

Example

This example moves the insertion point to the start of the current paragraph regardless of the length of the paragraph or the position of the insertion point within it. The first instruction selects the entire paragraph.


EditGoTo "\Para"
StartOfLine

The bookmark "\Para" is one of several predefined bookmarks that Word defines and updates automatically. For more information on predefined bookmarks, see "Operators and Predefined Bookmarks" later in this part.

See Also

EndOfLine, ParaUp, StartOfRow