In the example below, the variable ParaNum and ParaLengthwill 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 and ParaLength for the end point of a selection. The ReplaceSelection function on the next line will replace the current contents of the third paragraph with the string "Digital Workshop" in the Text object named Text1.
ParaNum = Text1.ParagraphIndex(2);
ParaLength = Text1.ParagraphLength(2);
Text1.SetSelection(ParaNum,ParaLength);
Text1.ReplaceSelection("Digital Workshop");
see also:ParagraphIndex