Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I've been given a form in Word 2002 that will be used by 2002-2010 users across the organisation which I've been asked to automate.

After struggling with hiding the Controls Toolbox toolbar checkboxes (as they're not part of the text that can be Hidden, I've switched to using Forms toolbar checkboxes.

I have exit macros on the checkboxes that either show or hide bookmarked text based on the value of each checkbox.

This all works wonderfully, except I can't figure out how (if it's possible) to have the macro run when the user ticks or unticks - at the moment I've only found the option to add an exit macro, which means they need to tab or click on something else afterwards before anything is revealed in the document.

Any ideas gratefully received!


share|improve this question

I know you gave up on hiding Controls ToolBox checkboxes, but they will give you more to work with. I am not sure how this would work with your page layout, but you might try setting the height and/or width of them, which essentially makes them hidden. This then gives you all of the other possibilities like Click events.

You would trigger their hidden state however you like with something like

CheckBox2.Height = 0
CheckBox2.Width = 0

and unhide the same thing with

CheckBox2.Height = 21.75
CheckBox2.Width = 108

which seem to be the default sizes

Then you will have the things like

Private Sub CheckBox2_Click()
CheckBox2.Caption="What a wonderful thing"

End Sub

You may manipulate the Wordwrap and Autosize properties if the caption is of any length

CheckBox2.AutoSize = True
CheckBox2.WordWrap = False
share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .