Share via


ITextRangeProvider::MoveEndpointByRange Method

Moves one endpoint of a text range to the specified endpoint of a second text range.

Syntax

HRESULT MoveEndpointByRange(      
    TextPatternRangeEndpoint endpoint,
    ITextRangeProvider *targetRange,
    TextPatternRangeEndpoint targetEndpoint
);

Parameters

  • endpoint
    [in] A value from the TextPatternRangeEndpointEnum enumerated type that specifies the endpoint to move.
  • targetRange
    [in] The address of the ITextRangeProvider interface of another range from the same text provider.
  • targetEndpoint
    [in] A value from the TextPatternRangeEndpointEnum enumerated type that specifies an endpoint on the other range.

Return Value

Returns S_OK if successful, or an error value otherwise.

Remarks

If the endpoint being moved crosses the other endpoint of the same text range then that other endpoint is moved also, resulting in a degenerate range and ensuring the correct ordering of the endpoints (that is, Start is always less than or equal to End).

See Also

UI Automation Providers Overview, ITextProvider