index > Visual Studio Tools for Office > Bookmarks alternatives?

Bookmarks alternatives?


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

JesseJ

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.




-- Cindy Meister (Word MVP)
Cindy Meister

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

JesseJ

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.




-- Cindy Meister (Word MVP)
Cindy Meister
reply 4

You can use google to search for other answers

 

More Articles

Help please : my SQL Query with VBA in Excel doesn't work...
Populate pivot table with pre selected items.
VS 2005 Tools for Office (English Version) doesn't work with Offi...
Intercepting Word's message pump
Cutomize File menu in Excel using VSTO 2005
Integration in an existing project
VSTO 2.0 Excel Project Recurring Compile Error
Microsoft outlook Plugin Compatibility
VSTO - Couple Questions - Macros & Smart Tags
XMI - Tool compatibility
Welcome to Bokebb   New Update   Joins the collection  
 

New Articles

Bullets = "?" with InsertXML
commandbarbutton click event doesn't fir…
Adding controls at runtime resulting error
How to set a Custom Color?
Why does the ContextSwitchDeadlock happe…
Excel 2007 Beta Charting Problem/Question
VSTO 'V3' Outlook Add-In Questions
Add-inn installed in word but not in oth…
Fastest way to load data into Excel?
DllUnregisterServer issue; err code 0x80…
After installing VSTO2005 no Office Temp…
Excel Chart properties from VB.Net 2005
Developing add-in for Outlook 2000 - spe…
Get text from _WwG Class
how to append (Excel) Cell contains in e…

Hot Articles

How to add Top Level Folder in Outlook
Unable to invoke BCM(Outlook) events.
Unspecified Error when trying to access …
C++ AddIns 4 MS-Word
Install VSTO Runtime without vstor.exe
Reading data from Excel through VB.NET
XML markup error when using InsertXML
Deploy VSTO word template
Most flexible deployment is to GAC?
Can a VSTO 2005 Excel Application be sta…
VSTO 2005 Beta2 Bookmark Relocate
<the system cannot find the reference…
We need a VSTO Excel stud (or studette)
How to change text on excel titlebar
Printing a MS Access report

Recommend Articles

Questions About VSTO
COM ADDIN NOT INSTALLING IN SOME PC'S
Performance issue
Visual Studio Tools for Office. Problem …
Treeview webpart in sharepoint portal se…
Word Template from ASP.NET
Word2007 Add-In: Can I customize the Wor…
Find.Execute throws "Command is not…
locking/unlocking bookmarks dynamically
strange behaviour with offline deploymen…
Using AxSpreadsheet
Add-In Only loads when debugging
Issue with Office Interop
writing into the document (VSTO - C#)
VSTO Deployment