Skip to main content
Version: 21

WP DELETE BOOKMARK

WP DELETE BOOKMARK ( wpDoc ; bkName )

ParameterTypeDescription
wpDocObject→4D Write Pro document
bkNameText→Name of bookmark to delete

Description​

The WP DELETE BOOKMARK command removes the bookmark named bkName from wpDoc.

If the bkName bookmark does not exist in wpDoc, the command does nothing.

Example​

You want to rename an existing bookmark. To do this, you need to create a new bookmark with the same range, and then delete the old one:

var $bookmarkOldName : Text
var $bookmarkNewName : Text
var $p : Integer
var $wpRange : Object

$bookmarkOldName:="MyBookmark"
$bookmarkNewName:="MyNewBookmark"

ARRAY TEXT($_bookmarks;0)
WP GET BOOKMARKS(WParea;$_bookmarks)

$p:=Find in array($_bookmarks;$bookmarkOldName)
If($p>0)
$wpRange:=WP Get bookmark range(WParea;$bookmarkOldName)
WP DELETE BOOKMARK(WParea;$bookmarkOldName)
WP DELETE BOOKMARK($wpRange;$bookmarkNewName)
End if

See also​

WP Bookmark range
WP GET BOOKMARKS
WP NEW BOOKMARK