ParagraphIndex()

In the example below, the variable ParaNum will contain the Index number for the third paragraph of the Text object Text1. The SetSelection function uses the number in ParaNum as the starting point for a selection – because this function does not specify an end point, the ReplaceSelection function on the next line will insert the string "Digital Workshop" at the beginning of the third paragraph of the Text object named Text1. Any other text in that paragraph will appear to the right of the inserted text.

ParaNum = Text1.ParagraphIndex(2);
Text1.SetSelection(ParaNum);
Text1.ReplaceSelection("Digital Workshop");

 

see also:ParagraphLength

Close