C
Chuck
hi all,
i have found a macro which will tell the word document to either print
or not print depending if there is a check within a checkbox
the macro seems simple and since then i have coppied the macro
accordingly to apply to ther existing checkboxes.
however, it seems that on some checkboxes (using bookmarks), that word
just will not do what i am asking it to do via the macro
this is the macro
=============
Sub Check01()
With ActiveDocument
.Unprotect
If .FormFields("Check01").CheckBox.Value = False Then
.Bookmarks("Check01Text").Range.Font.Hidden = True
Else
.Bookmarks("Check01Text").Range.Font.Hidden = False
End If
.Protect wdAllowOnlyFormFields, NoReset
End With
End Sub
Sub Check02()
With ActiveDocument
.Unprotect
If .FormFields("Check02").CheckBox.Value = False Then
.Bookmarks("Check02Text").Range.Font.Hidden = True
Else
.Bookmarks("Check02Text").Range.Font.Hidden = False
End If
.Protect wdAllowOnlyFormFields, NoReset
End With
End Sub
============
ect.. there is about 10 of these with the correct formfield names &
bookmark names. and yes, i have told each form field checkbox to run
macro on exit
can anyone advise why this only wants to work say ... 75% of the time?
cheers
i have found a macro which will tell the word document to either print
or not print depending if there is a check within a checkbox
the macro seems simple and since then i have coppied the macro
accordingly to apply to ther existing checkboxes.
however, it seems that on some checkboxes (using bookmarks), that word
just will not do what i am asking it to do via the macro
this is the macro
=============
Sub Check01()
With ActiveDocument
.Unprotect
If .FormFields("Check01").CheckBox.Value = False Then
.Bookmarks("Check01Text").Range.Font.Hidden = True
Else
.Bookmarks("Check01Text").Range.Font.Hidden = False
End If
.Protect wdAllowOnlyFormFields, NoReset
End With
End Sub
Sub Check02()
With ActiveDocument
.Unprotect
If .FormFields("Check02").CheckBox.Value = False Then
.Bookmarks("Check02Text").Range.Font.Hidden = True
Else
.Bookmarks("Check02Text").Range.Font.Hidden = False
End If
.Protect wdAllowOnlyFormFields, NoReset
End With
End Sub
============
ect.. there is about 10 of these with the correct formfield names &
bookmark names. and yes, i have told each form field checkbox to run
macro on exit
can anyone advise why this only wants to work say ... 75% of the time?
cheers