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);
int StartOf(TextRangeUnit const& unit, bool const& extend);
public int StartOf(TextRangeUnit unit, bool extend);
function startOf(unit, extend)
Public Function StartOf (unit As TextRangeUnit, extend As Boolean) As Integer

Parameters

unit
TextRangeUnit

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

extend
Boolean

bool

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

Int32

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.

Applies to

See also