G
Greg Maxey
Try this:
Sub Test()
Dim oPar As Paragraph
ActiveWindow.View.ShowHiddenText = True
On Error Resume Next
ActiveDocument.Unprotect
On Error GoTo 0
For Each oPar In ActiveDocument.Paragraphs
With oPar.Range
If .FormFields.Count > 0 Then
On Error GoTo Proceed
If .FormFields(1).Type = wdFieldFormCheckBox Then
If .FormFields(1).CheckBox.Value = False Then
oPar.Style = "Hidden"
Else
Proceed:
oPar.Style = "Normal"
End If
End If
End If
End With
Next
ActiveDocument.Protect Type:=wdAllowOnlyFormFields, noreset:=True
ActiveWindow.View.ShowHiddenText = False
End Sub
Sub Test()
Dim oPar As Paragraph
ActiveWindow.View.ShowHiddenText = True
On Error Resume Next
ActiveDocument.Unprotect
On Error GoTo 0
For Each oPar In ActiveDocument.Paragraphs
With oPar.Range
If .FormFields.Count > 0 Then
On Error GoTo Proceed
If .FormFields(1).Type = wdFieldFormCheckBox Then
If .FormFields(1).CheckBox.Value = False Then
oPar.Style = "Hidden"
Else
Proceed:
oPar.Style = "Normal"
End If
End If
End If
End With
Next
ActiveDocument.Protect Type:=wdAllowOnlyFormFields, noreset:=True
ActiveWindow.View.ShowHiddenText = False
End Sub