Procedure TWPCustomRtfEdit.Clear

Unit: WPCTRMemo
Class: WPCTRMemo.TWPCustomRtfEdit

Description

This procedure erases the complete text buffer (). If you want to add text you need to create a new , for example with the the line ActiveText:=HeaderFooter.Get(). If you just need a new body text with the cursor placed on a new empty paragraph use the procedure CheckHasBody. This procedure is also called when the editor gets the focus.
WPRichText1.Clear; WPRichText1.ActiveText:= WPRichText1.HeaderFooter.Get(wpIsHeader,wpraOnAllPages,''); WPRichText1.TableAdd(4,4,[wptblActivateBorders]); WPRichText1.DisplayedText := WPRichText1.BodyText; The Clear procedure will also delete all styles. If you need to keep those use . The current page size will remain unchanged if the flag wpDontResetPagesizeInClear was used in EditOptionsEx.
This function should not be called when you are working with a shared TWPRTFProps object.