GetRange Method of the Text Object

This method allows you to get a copy of a text range. You can insert the resulting text into the text of a paragraph (the IParagraph::InsertText method).

Syntax

HRESULT GetRange(
  int     FromParagraph,
  int     FromPos,
  int     ToParagraph,
  int     ToPos,
  IText** Result
);
    

Parameters

FromParagraph
[in] Variable specifying the index of the paragraph for the starting point of the range to be copied.
FromPos
[in] Variable defining the index of character in the starting paragraph, for the starting point of the range to be copied.
ToParagraph
[in] Variable defining the index of the paragraph for the ending point of the range to be copied.
ToPos
[in] Variable defining the index of character in the ending paragraph, for the ending point of the range to be copied. This character itself is not included in the copied text.
Result
[out, retval] A pointer to the IText* pointer variable that receives the interface pointer of the Text object representing the range. Result should not be NULL. *Result must be NULL; otherwise, an error code is returned.

Return values

This method has no specific return values. It returns the standard return values of ABBYY FineReader Engine functions.

Remarks

The ending position of the range should be farther in the text than the starting one; otherwise, an error code is returned. The symbol in (FromParagraph;FromPos) position is included in the range, while the character in (ToParagraph;ToPos) position is not included. To get a copy of the whole text, pass the (0;0) coordinates for the beginning of the range, and the "special position" coordinates for the end of the range.

See also

Text

7/3/2024 8:50:10 AM

Usage of Cookies. In order to optimize the website functionality and improve your online experience ABBYY uses cookies. You agree to the usage of cookies when you continue using this site. Further details can be found in our Privacy Notice.