I want to replace the text entered in the bookmark after importing bookmarks in the office.
oDocument.BookmarkRange(‘title’)
Is there a separate object like replace?
Or if I want to delete the text in the bookmark and insert new text?
I want to replace the text entered in the bookmark after importing bookmarks in the office.
oDocument.BookmarkRange(‘title’)
Is there a separate object like replace?
Or if I want to delete the text in the bookmark and insert new text?
Hello @Hyun
Do you mean the name of a bookmark?
If so then the only way is to get range of a bookmark, delete old one and add new on the same range:
var oDocument = Api.GetDocument();
var oRange = oDocument.GetBookmarkRange("<current_bookmark_name>");
oDocument.DeleteBookmark("<current_bookmark_name>");
oRange.AddBookmark("<new_bookmark_name>");
Methods used are GetBookmarkRange, DeleteBookmark and AddBookmark.