If the user selects and deletes text that contains one or more bookmarks, how can I be notified of this event? I need to know the names of any bookmarks that were deleted using the delete or backspace keys, as well as those being cut to the clipboard.
Notification when user deletes bookmark
-
-
- Offizieller Beitrag
Hi,
There are no such notifications since the embedded objects are deleted and recreated while the text is edited. You will need to work with a object list (procedure BookmarkGetList(list: TWPTextObjList; FromAllBlock: Boolean = FALSE);)
Regards,
Julian -
Please paste some code to determine the list of bookmarks that are contained in the currently selected text. Assume that the document could contain any number of bookmarks and that the user may have selected text which contains only a few of them.
-
- Offizieller Beitrag
You need an eventhandler of this type:
procedure Form1.TextObjCallback(Sender: TObject;
TxtObj: TWPTextObj;
par: TParagraph;
posinpar: Integer;
var Abort: Boolean) of object;Using TextObj You can check for bookmark objects.
Now You can call
WPRichText1.HeaderFooter.CallForSelectedText(
Self, [], nil, nil, nil, TextObjCallback);to make TextObjCallback be called for all objects in the selection.
Julian