Right-click to delete bookmark??

  • Ok, I already figured out how to delete the bookmark with right-click. But now, I have another problem: when I delete a bookmark the first time, averything goes fine. So, I add another bookmark in the exact same place where the other were. Now, when I delete that second bookmark, it is delete from the bookmark list, but the text remains in the WPRichText component until I the application is closed. Please, somebody help me.


    And sorry for my bad english...

    • Offizieller Beitrag

    Hi,

    Bookmarks conists of start and end tags, <a name = ..>text</a>

    so deleiting the bookmarks only means the tags <a> and </a> is deleted. The closing is usually deleted - you can check that when enabling the display of bookmarks in ViewOptions.

    To delete the text, too, you can use BookmarkSelect and then ClearSelection.

    Julian Ziersch

  • Thanks Julian, but i'm already using BookmarkSelect and ClearSelection. The first time, everything goes well, but when I insert a new bookmark in the same place, and then delete tha bookmark, the bookmark is deleted from the bookmark list, but the text remains. I don't understand this... :shock:

  • Here is the code I'm using:

    Something wrong with that??

    Thanks

    Einmal editiert, zuletzt von manphys (2. August 2005 um 20:17)

  • I tried this too, but didn't work either:

    Code
    procedure RemoveTag(var Editor: TWPRichText; TagName);
    begin
       TagName := Concat(TagStart, TagName, TagEnd;
       Editor.BookmarkSelect(TagName, False);
       Editor.CurrAttr.DeleteStyle([afsProtected]);
       Editor.ClearSelection;
       Editor.SelectionAsString := '';
       Editor.HideSelection;
       Editor.Refresh;
    end;