Skip to main content
ITextRange2::GetSubrange method

Retrieves a subrange in a range.

Syntax


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

Parameters

iSubrange [in]

Type: long

The subrange index.

pcpFirst [out]

Type: long*

The character position for the start of the subrange.

pcpLim [out]

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 valueSubrange
Equals zeroGets the current active subrange.
Greater than zeroGets the subrange at the index specified by iSubrange, in the order in which the subranges were added. This requires extra calculation.
Less than zeroGets 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

Minimum supported client

Windows 8 [desktop apps only]

Minimum supported server

Windows Server 2012 [desktop apps only]

Header

Tom.h

DLL

Msftedit.dll

See also

ITextRange2