![]() |
#2
|
||||
|
||||
![]()
I would be trying to design a way of tagging each checkbox with the expected value. For instance, the macro loops across all the checkboxes to check if, in each case, the value matches the tag.
I think the only way to tag a legacy form checkbox is to use its bookmark value. For instance, you could set the bookmark values of Q1a0, Q1b0, Q1c1, Q1d0 such that the last character tells you which one(s) need to be true. Then the loop can compare the checkbox values to this information and arrive at the correct/incorrect decision. For example the following code Code:
Sub CheckCbs() Dim aFF As FormField, bAnswer As Boolean bAnswer = True For Each aFF In ActiveDocument.FormFields Debug.Print aFF.Range.Bookmarks(1).Name, Right(aFF.Range.Bookmarks(1).Name, 1) = aFF.CheckBox.Value bAnswer = bAnswer And Right(aFF.Range.Bookmarks(1).Name, 1) = aFF.CheckBox.Value Next aFF MsgBox bAnswer End Sub
__________________
Andrew Lockton Chrysalis Design, Melbourne Australia |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Macro (or something) to run Spell Check within rich text content boxes in lock document | NMBELL | Word | 8 | 12-21-2015 04:09 PM |
Word2010 check boxes and plain text content control boxes in same table | fcsungard | Word | 5 | 06-01-2012 01:16 AM |
![]() |
funkyspirit | Word | 3 | 05-23-2012 08:39 AM |
![]() |
jellyrolls | Office | 4 | 07-15-2011 08:07 PM |
Problem with Developer Form -- Check Boxes and Text Boxes | PCC | Word | 1 | 05-16-2009 05:22 AM |