Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
conditional checkbox??
I am trying to use some checkboxes in a conditional if statement. I don't
know what to put in place for Expression2. I want it to be the value when the box is checked, but don't know what that is. Any ideas? |
#2
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
conditional checkbox??
I don't know of any way to evaluate the state of a formfield check box in Word.
This macro will add a document variable for each check box in the document. The variable will be named the same as the check box. If you set this as the exit macro for the check boxes, or include this code in the exit macro for the check boxes, it will update the value of the variables. Dim objFormField As FormField On Error Resume Next For Each objFormField In ActiveDocument.FormFields If objFormField.Type = wdFieldFormCheckBox Then ActiveDocument.Variables.Add Name:=objFormField.Name ActiveDocument.Variables(objFormField.Name).Value = objFormField.Result End If Next objFormField That means you'll be able to use something like { DOCVARIABLE "Check1" } for Expression2. Note that you'll have to exit from a check box before the values will be updated correctly, but once you do that, your IF field will work. Bear -- Windows XP, Word 2000 |
#3
Posted to microsoft.public.word.docmanagement
|
|||
|
|||
conditional checkbox??
Thanks, I would have thought there would have been an easier way.
I'm going to go with a few dropdown boxes this time. "Bear" wrote: I don't know of any way to evaluate the state of a formfield check box in Word. This macro will add a document variable for each check box in the document. The variable will be named the same as the check box. If you set this as the exit macro for the check boxes, or include this code in the exit macro for the check boxes, it will update the value of the variables. Dim objFormField As FormField On Error Resume Next For Each objFormField In ActiveDocument.FormFields If objFormField.Type = wdFieldFormCheckBox Then ActiveDocument.Variables.Add Name:=objFormField.Name ActiveDocument.Variables(objFormField.Name).Value = objFormField.Result End If Next objFormField That means you'll be able to use something like { DOCVARIABLE "Check1" } for Expression2. Note that you'll have to exit from a check box before the values will be updated correctly, but once you do that, your IF field will work. Bear -- Windows XP, Word 2000 |
Reply |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
check in a checkbox | Microsoft Word Help | |||
Checkbox | Microsoft Word Help | |||
Conditional Slash Similar to Conditional Hyphen? | Page Layout | |||
IF THEN ELSE with FORM CHECKBOX | Mailmerge | |||
Displaying Checkbox | Mailmerge |