ITextRange2::GetSubrange method (tom.h)

Retrieves a subrange in a range.

Syntax

HRESULT GetSubrange(
  [in]  long iSubrange,
  [out] long *pcpFirst,
  [out] long *pcpLim
);

Parameters

[in] iSubrange

Type: long

The subrange index.

[out] pcpFirst

Type: long*

The character position for the start of the subrange.

[out] pcpLim

Type: long*

The character position for the end of the subrange.

Return value

Type: HRESULT

If the method succeeds, it returns NOERROR. Otherwise, it returns an HRESULT error code.

Remarks

Subranges are selected as follows.

iSubrange value Subrange
Equals zero Gets the current active subrange.
Greater than zero Gets the subrange at the index specified by iSubrange, in the order in which the subranges were added. This requires extra calculation.
Less than zero Gets the subrange at the index specified by iSubrange, in increasing character position order.
 

See ITextRange2::GetCount for the count of subranges not including the active subrange.

Requirements

Requirement Value
Minimum supported client Windows 8 [desktop apps only]
Minimum supported server Windows Server 2012 [desktop apps only]
Target Platform Windows
Header tom.h
DLL Msftedit.dll

See also

ITextRange2