locked
Bookmarks alternatives? RRS feed

  • Question

  • I'm using VSTO 2005 to write a Word 2003 customization that uses bookmarks to remember specific document ranges between sessions. Even though I'm using hidden bookmarks, it seems like there must be a better way to do this. Roughly, my customization creates hidden bookmarks when my users highlight a part of their document and click a button I've created to store special structured annotations about the text they've highlighted. The annotation object stores the name of the bookmark, and when the annotation is clicked, the bookmark is selected. One problem (among other limitations with bookmarks) is that the users can still check the "show hidden" box and delete my hidden bookmarks.

    Is there another structure that functions like a bookmark that I just don't know exists that might have more flexibility, and be completely hidden from the user? Is this one of the reasons the content control was created for Word 2007?

    Thanks in advance,

    Jesse

    Thursday, October 5, 2006 7:41 AM

Answers

  • There really isn't anything "better" than a bookmark, I'm afraid. Word wasn't originally designed with any "protection" kind of functionality in mind; beyond the Document Variable object, pretty much everything is visible/available for the user. In recent years, the requirements for "protection" have been recognized and some work has been done; and, yes, content controls are one of the results :-)

    You might consider replacing the Insert/Bookmark menu with your own CommandBarButton control (be sure to set CustomizationContext to your own template or the individual document so that you don't "axe" the capability for the entire Word installation). You'd have to rebuild the functionality of Word's own Bookmark dialog box, leaving out what you don't want users to access. But in this particular case, rebuilding the functionality should be possible.

    A savvy user could still get into Tools/Customize/Commands and drag the command back out. But I can't imagine anyone wanting to delete your bookmarks deliberately.

    Thursday, October 5, 2006 8:01 AM

All replies

  • There really isn't anything "better" than a bookmark, I'm afraid. Word wasn't originally designed with any "protection" kind of functionality in mind; beyond the Document Variable object, pretty much everything is visible/available for the user. In recent years, the requirements for "protection" have been recognized and some work has been done; and, yes, content controls are one of the results :-)

    You might consider replacing the Insert/Bookmark menu with your own CommandBarButton control (be sure to set CustomizationContext to your own template or the individual document so that you don't "axe" the capability for the entire Word installation). You'd have to rebuild the functionality of Word's own Bookmark dialog box, leaving out what you don't want users to access. But in this particular case, rebuilding the functionality should be possible.

    A savvy user could still get into Tools/Customize/Commands and drag the command back out. But I can't imagine anyone wanting to delete your bookmarks deliberately.

    Thursday, October 5, 2006 8:01 AM
  • Thanks for the info and the incredibly speedy reply. I'm actually creating the underlying bookmarks programmatically, so the user doesn't actually realize that they're being created--helped in part that I'm making them hidden. My business analyst is concerned that a user could potentially see the bookmarks and mess with them just to experiment (or because they don't think they should be there...you know users ;)

    We use revision control for these documents anyway, so I'll just have to push back on this issue. Sounds like bookmarks are the best I can do until 2007. Thanks!!

    Jesse

    Thursday, October 5, 2006 8:11 AM
  • Hi Jesse

    One thought for the business analyst, then : Microsoft itself uses the same technique for managing cross-references, tables of contents, OLE links and similar things. (_Ref, _TOC and OLE_ bookmarks). So the "vulnerability" is built into Word by Microsoft and the same risk is run for any document that uses such features. Your risk is neither unique nor is the concept behind the risk "yours".

    As a "backup" you could store the actual text that was in the bookmark when it was created. If the bookmark can't be found, you can notify the user (include a "Help" button that describes how the annotations are managed and how to NOT delete the bookmarks another time) and ask if a search for the text should be made (possibly with wildcards if the exact text can't be found). That may or may not turn up the location, but at least you're informing and trying to recover the situation. 

    Thursday, October 5, 2006 8:32 AM