Howdy,
What I want to do:
Create a button on a MS word document that when clicked will show/hide text.
What I did:
1. created a button using the macro {Macrobutton Mymacro Show/Hide}
2. Bookmarked series of text under "bookmark1", "bookmark2", etc.
3. I can create a macro for each bookmarks:
Code:
Sub MYMACRO()
ActiveDocument.Bookmarks(bookmark1).Range.Font.Hidden = Not ActiveDocument.Bookmarks(bookmark1).Range.Font.Hidden
End Sub
This is very crude but I am not a full-time programmer.
My question:
Instead of creating a macro for each bookmark, is there a way for the macro to act as a function and with a variable?
What I want to do is basically make a variable macro, make the macrobutton call to a specific bookmark and have the macro be applied to that bookmark. Instead of writing a different macro with a different bookmark each time, I just want to create a button that will apply the macro to the variable bookmark called each time.
The final purpose is to show/hide 200 pages of text into 50.
I attached an example of what I have done.
I was wondering if it was possible to make OBERON's speech hidden on button toggle without having to write a new line of macro code.
Cheers!