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.
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:
C_TEXT($bookmarkOldName)
C_TEXT($bookmarkNewName)
C_LONGINT($p)
C_OBJECT($wpRange)
$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