Objects in TWPRichText

  • I need delete (in code) generic embeed objects from a document.

    The problem is that the Delete() and DeleteObject() from TextObjects collection in TWPRichText don't erase the object from de document. The "erased" objects stay in and showing in document.

    How I can delete embeed objects from document (checks, combos, memos and edits)???

    Thanks

    • Offizieller Beitrag

    >>I need delete (in code) generic embeed objects from a document.

    The problem is that the Delete() and DeleteObject() from TextObjects collection in TWPRichText don't erase the object from de document. The "erased" objects stay in and showing in document.

    <b>How I can delete embeed objects from document (checks, combos, memos and edits)???</b><<

    The objects are not deleted as long as they remain in the undo buffer.

    Since it does no harm if only the ObjectReference (PTTextObj) stays allocated and 'obj' is nil - you can do a

    PTTextObj^.obj.Free;
    PTTextObj^.obj := nil;
    TextObjects.DeleteObject(PTTextObj);

    Julian