Changing Word's bookmark characters

B

Byron

I have a bunch of templates that make heavy use of bookmarks. I'm
trying to make it difficult for the users to accidentally delete them.
Is there a way to change the character that Word uses to display a
bookmark's start and end position? I would like to make it more
visible to the user. I set ShowBookmarks to true so that the users
can at least see them. I've also added the code below to the
document_new event.

Thanks,

code:
Dim bm As Bookmark, r As Range

For Each bm In ActiveDocument.Bookmarks
Set r = bm.Range
r.Collapse wdCollapseStart
r.Text = Chr$(135)
r.Font.Color = wdColorRed
r.Font.Hidden = True
Set r = bm.Range
r.Collapse wdCollapseEnd
r.Text = Chr$(135)
r.Font.Color = wdColorRed
r.Font.Hidden = True
Next
 
P

Peter Hewett

Hi ?

Bookmarks are always somewhat problematic. You can of course protect the
document for forms, but this approach is very limited and only really
useful if you're using FormFields as intended. You can of course change the
colour of any bookmarked text to make it more obvious that it's bookmarked.
The other approach is to use an input form to solicit data from the user
and have the form fill in the bookmarks. That way the bookmarks have
already been used and if the user edits the text and deletes the bookmark
then it's no big deal.

I can see what your codes doing but I'm not sure why. If it's an attempt to
identify an area that's not currently but was previously bookmarked then
it's a long way from bullet proof. Also you can get some unwanted and
undesirable side effects and the hidden text becomes visable (and easily
deletable) if users enable Tools/Options/View/Formatting Marks/All. Many
Word users particularly the advanced ones work with this option on.

My advice is to live with the limitations of bookmarks and try to approach
the problem from another direction if possible.

Oh yeah, sorry there's no way of changing Words bookmark character.

HTH + Cheers - Peter


(e-mail address removed) (Byron) wrote in
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top