WPCubed Product Support

Notification when user deletes bookmark

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.

#1 ♥ 0
4.2k Views 2 users read 1 min
support

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

#2 ♥ 0

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.

#3 ♥ 0
support

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

#4 ♥ 0
This category is archived. No new posts are possible.