Check box and controlling what can be viewed when checked

actolex31
actolex31 used Ask the Experts™
on
I'm not experienced in Word, but have Access, Excel, and InfoPath experience that I would like to include in Word.  What I want to do is to include some check boxes or even combo boxes in a table in a Word document.  I want the user to answer a few questions in the Word doc and have the document display certain parts of the document based on what is selected in the check boxes/combo boxes.  

The goal is to have a template that includes all possible information for multiple scenarios, but only have the applicable text displayed based on what the user selects.
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Retired
Top Expert 2012
Commented:
It can be done with Form field controls or ActiveX controls and VBA, but it is not entirely satisfactory. A Word document is not intended for interactive use and any controls are intended to help the author in the editing task, and controls (especially ActiveX) can look incongruous when printed.

There is a 'Hidden' attribute that can be applied to parts of the text, so that unless the Option to display such text is set, it will disappear and appear at will.

Here is some simple sample code
Option Explicit

Private Sub CheckBox1_Click()
    ActiveDocument.Bookmarks("bmkText1").Range.Font.Hidden = CheckBox1.Value
End Sub

Open in new window

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial