how to use the field code hidden to hide a bookmark.

P

pj

I simply want a field code to slect a bookmark and then hide it. I can do
this partially by going to Insert -> Field -> GOTOBUTTON then enter the name
of my bookmark and behind it a trigger word. When the trigger word is
clicked, the field code selects my bookmark, but then i have to manually go
to Format -> Font -> Hidden to hide the bookmark. Instead I would like to
use the Field code MACROBUTTON Hidden to hide the bookmark.

I'm using a public library computer that uses Microsoft Word 2000.
 
G

Greg Maxey

pj,

not sure I copy. You want to click a macrobutton that will hide some
bookmarked text. Lets call the bookmark "Test"

Try something like this:

{ MacroButton Hidden "Click to show/hide bookmark text" }

The code:

Sub Hidden()
Dim myRng As Range
Set myRng = ActiveDocument.Bookmarks("Test").Range
If myRng.Font.Hidden = False Then
myRng.Font.Hidden = True
Else
myRng.Font.Hidden = False
End If
End Sub
 

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