Syntax
GetText$(CharPos1, CharPos2)
Remarks
Returns the text (unformatted) from CharPos1 through CharPos2. Note that GetText$() does not return hidden text that is not displayed even though Word counts hidden characters when determining the range of text to return. Though GetText$() can be handy if you need to return document text without changing the selection, special document elements such as fields, tables, and page breaks within the specified range can produce unpredictable results.
Argument | Explanation |
CharPos1 | The character position that defines the beginning of the range, relative to the start of the document, which has a character position of 0 (zero) |
CharPos2 | The character position that defines the end of the range |
Example
This example sets the variable a$ to the first 10 characters in the document:
a$ = GetText$(0, 10)
See Also
GetSelEndPos(), GetSelStartPos(), SetSelRange