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
C++
HRESULT GetRange( int FromParagraph, int FromPos, int ToParagraph, int ToPos, IText** Result );
C#
IText GetRange( int FromParagraph, int FromPos, int ToParagraph, int ToPos );
Visual Basic .NET
Function GetRange( _ FromParagraph As Integer, _ FromPos As Integer, _ ToParagraph As Integer, _ ToPos As Integer _ ) As IText
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
17.09.2024 15:14:40