ITextRange.StartOf(TextRangeUnit, Boolean) ITextRange.StartOf(TextRangeUnit, Boolean) ITextRange.StartOf(TextRangeUnit, Boolean) ITextRange.StartOf(TextRangeUnit, Boolean) Method

Definition

Moves or extends the text range to the start of the nearest specified text unit. The text range is moved or extended backward in the document.

public : int StartOf(TextRangeUnit unit, bool extend)
int32_t StartOf(TextRangeUnit unit, bool extend) const;
public int StartOf(TextRangeUnit unit, Boolean extend)
Public Function StartOf(unit As TextRangeUnit, extend As Boolean) As int

Parameters

unit
TextRangeUnit TextRangeUnit

The unit by which to move the start position of the text range. The default value is Word.

extend
Boolean Boolean

True extends the text range by moving just the start position of the range to the start of the specified unit. False moves both ends of the text range to the start of the specified unit. The default value is false.

Returns

int int

The number of characters the insertion point or start position is moved. Note that this value is always less than or equal to zero, since the motion is always toward the beginning of the story.

Remarks

If the text range is an insertion point on a boundary between unit s, this method does not change the start position.

The start position does not change if unit is set to Character.

See also