Form Check Box Options

I have a form with YES and NO check box options. If NO is selected/checked the box will fill with the typical X. 

If YES is selected, not only do I want the X, I also want a couple paragraphs of new text/or a new section to appear directly under the check boxes. 

Is it possible to do this kind of thing in Word? Perhaps I need Visual Basic or… 

Any help would be appreciated. Thanks! 

You would need to use a little bit of VBA code as follows


With ActiveDocument
    If .FormFields("Check1").CheckBox.Value = True Then
        .Variables("varAltText").Value = vbCr & "some text"
        .range.Fields.Update

   Else

        .Variables("varAltText").Value = " "
    End If
End With


Insert a { DOCVARIABLE varAltText } field before the end of paragraph mark (¶) of the paragraph before where you want the alternate text to appear.


You must use Ctrl+F9 to insert the { } and Alt+F9 to toggle off the display of the field codes.

Hope this helps,
Doug Robbins - MVP Office Apps & Services (Word)
dougrobbinsmvp@gmail.com

1 person found this reply helpful

·

Was this reply helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

Many thanks Doug,

I am totally new to VBA but I will give it try.

Thanks again,

Was this reply helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

Do you (and will all of your document users) have access to Word 2010 or higher?  If so, you might consider mutually exclusive content control checkboxes.  This way the user can't inadvertently select both yes and no: http://gregmaxey.mvps.org/word_tip_pages/mutually_exclusive_content_control_option_buttons.html

Greg Maxey
***
Death smiles at us all, but all a man can do is smile back.


For more help with Word visit:
http://gregmaxey.com/word_tips.html

Was this reply helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

That is a good question Greg, some may use 2007. Thank you for the link. I will have a look.

Was this reply helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

Oh no good.  The brainiacs at MS didn't provide the checkbox CC until version 2010 :-(.


Another possibility is to use a dropdown with the list entries Yes and No. 

Greg Maxey
***
Death smiles at us all, but all a man can do is smile back.


For more help with Word visit:
http://gregmaxey.com/word_tips.html

Was this reply helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

 
 

Question Info


Last updated April 14, 2025 Views 651 Applies to: