Open Riant opened 3 years ago
@askonev Please take a look
@Riant Hi! Created an enchancement #51952
in our private repository to extend bookmarking methods. But at the moment you can interact with the data for which the bookmark was created as a Range
object to which all methods of the ApiRange class are applicable.
Possible solution to replace the data to which the bookmark references.
oDocument = Api.GetDocument();
oParagraph = oDocument.GetElement(0);
oParagraph.AddText( "ONLYOFFICE Document Builder ");
oRange = oDocument.GetRange(0, 9);
oRange.AddBookmark("Bookmark");
oBookmarkRange = oDocument.GetBookmarkRange("Bookmark");
oBookmarkRange.Delete();
oRange = oDocument.GetRange(0, 0);
oRange.AddText('Api methods for ');
oRange.AddBookmark("Bookmark_2");
ver. 6.3.2.8
@askonev I need to use this api in plugin, so your solution does not make scene for a document which uploaded by user, because we can not get the deleted bookmark range, and it is not (0, 0) in most cases.
So we need a ApiRange method to do that.
Thanks.
@Riant, I understand you. At the moment, it remains only to wait for the decision of the developers.
Do you want to request a feature or report a bug? Request a feature
I need to change the bookmark text, for now, I can get bookmark range from document like below, but there is not any way to change the range text.
Is there any other API can do slimier things?
Thanks.