| Collapse | |
![]() rTextRange ![]() Collection As rtCollection endObject ID startObject Text useSpecialCharacters | version 1.5
Function Collapse (cDirection As Integer) As rTextRange Use Collapse method to move insertion point to one end or other. After Find/FindNext method, following Insert will overwrite all text with the Insert argument. In case Insert argument is not a string but other object it is inserted in place of selected text. Calling Collapse with parameters RT_COLLAPSE_START or RT_COLLAPSE_END will move the selection to one end or other and will not overwrite. set rtr = ctx.Find ("Greece*^p", RT_FIND_WILDCARDS + RT_FIND_SPECIALCHARACTERS) rtr.Collapse RT_COLLAPSE_START rtr.Insert docLink will select all text between "Greece" and the beginning of the next paragraph (including), move insertion point before "Greece" and will insert the object "docLink". Alternatively we could use string as Insert parameter: rtr.Insert "Modern " will insert string "Modern " before "Greece". |