Function TParagraph.Duplicate(CopyText:Boolean; CopyChildren:Boolean; LinkBefore:Boolean; modes:TWPCopyParModes) : TParagraph

Unit: WPRTEDefs
Class: WPRTEDefs.TParagraph

Parameters

  • CopyText:Boolean
  • CopyChildren:Boolean
  • LinkBefore:Boolean
  • modes:TWPCopyParModes

Returns

The type of the result value is TParagraph.

Description

This function duplicates this paragraph (and the children) and returns the reference of the new paragraph which is linked as 'NextPar'.
If the paragraph is a table row a new table row will be created.
Parameters: 'CopyText' - copy the contents of the paragraph. The children (other than the cells in a table row) will never be copied. If LinkBefore = true the created paragraph will be not placed before the current paragraph, othewise after it.
If you need to copy a table row you can use this code: aRow:=aRow.Duplicate(false, true, false, [wpParCopyStyleswpParCopyStyles,wpDontCopyCellSubParagaraphs]) This will copy the cells which are the children of the table row but not their sub paragraphs.