Gets a bookmark's range. Throws an error if the bookmark does not exist.


Gets a bookmark's range. Returns a null object if the bookmark does not exist.


Deletes a bookmark, if it exists, from the document.


Gets the names all bookmarks in or overlapping the range. A bookmark is hidden if its name starts with the underscore character.


Inserts a bookmark on the range. If a bookmark of the same name exists somewhere, it is deleted first.
when we insertText, a new range is returned, we need to use that range to insertBookmark. (context) 
    let range = context.document.getSelection();
    return context.sync().then(function ()
        let insertedTextRange = range.insertText(`Test Bookmark`, Word.InsertLocation.replace);

        let uniqueStr = new Date().getTime();
        let bookmarkName = `Test_BookmarkCode_${uniqueStr}`;

© 2022 Better Solutions Limited. All Rights Reserved. © 2022 Better Solutions Limited TopPrevNext