i have a form that includes multiple sections. sections can have checkboxes
and/or dropdown fields.
i want to allow the user to go thru the sections and check boxes pick from
drop downs.
once they are done i want them to have a toolbar button that will "hide" any
unchecked boxes and any unselected drop down boxes.
I don't want to delete the unchecked/unselected boxes since the user will
reuse the document in the future. I just need the unchecked boxes and any
unselected drop down boxes to be hidden, so, the document can be
view/printed/faxed, ect without all the clutter of the unneccesary text.
any advice would be appreciated.
thanks
JB914
This assumes that the first item of each dropdown field is one or more
spaces to produce a blank field:
Sub Test()
Dim oFF As FormField
Dim oFFs As FormFields
If ActiveDocument.ProtectionType <> wdNoProtection Then
ActiveDocument.Unprotect
End If
Set oFFs = ActiveDocument.FormFields
For Each oFF In oFFs
Select Case oFF.Type
Case wdFieldFormCheckBox
If oFF.Result = False Then
oFF.Range.Font.Hidden = True
End If
Case wdFieldFormDropDown
If oFF.DropDown.Value = 1 Then
oFF.Range.Font.Hidden = True
End If
End Select
Next
ActiveDocument.Protect wdAllowOnlyFormFields, True
End Sub
Sub Reset()
Dim oFF As FormField
Dim oFFs As FormFields
If ActiveDocument.ProtectionType <> wdNoProtection Then
ActiveDocument.Unprotect
End If
Set oFFs = ActiveDocument.FormFields
For Each oFF In oFFs
oFF.Range.Font.Hidden = False
Next
ActiveDocument.Protect wdAllowOnlyFormFields, True
End Sub
> i have a form that includes multiple sections. sections can have checkboxes
> and/or dropdown fields.
[quoted text clipped - 14 lines]
> thanks
> JB914
jb914 - 07 Dec 2006 15:49 GMT
Thanks Greg!! That helps.
> This assumes that the first item of each dropdown field is one or more
> spaces to produce a blank field:
[quoted text clipped - 54 lines]
>> thanks
>> JB914