S
Steve C
I am setting up a Word template with a two column table (about 30 rows). In
each cell in the first column, I'm using the Control Box toolbar to insert a
checkbox. The second column contains various legal statements. I would like
the user to be able to check any of the desired statements he/she wishes to
include in the document they're printing.
Once they are done checking off what they want included, I tried creating an
Update command button on the document which, when clicked, searches which
checkboxes are checked. If unchecked, delete the whole row so it doesn't
print (that works fine). If checked, keep the statement but delete/hide only
the checkbox for printing purposes (I can't get this to work). This is the
code I tried for the first checkbox:
Private Sub cmdUpdate_Click()
' If checkbox not checked, go to bookmark in first row and delete entire
row
If chkBox1.Value = False Then
Selection.GoTo What:=wdGoToBookmark, Name:="Row1Text"
Selection.SelectRow
Selection.Rows.Delete
ElseIf chkBox1.Value = True Then
ActiveDocument.ToggleFormsDesign ' toggle on Design mode
Selection.GoTo What:=wdGoToBookmark, Name:="Row1Text"
Selection.Delete Unit:=wdCharacter, Count:=1 'delete Checkbox cell
contents
ActiveDocument.ToggleFormsDesign ' toggle off Design mode
End If
End Sub
Am I making this too hard? Any suggestions would be appreciated! Thanks.
Steve C
each cell in the first column, I'm using the Control Box toolbar to insert a
checkbox. The second column contains various legal statements. I would like
the user to be able to check any of the desired statements he/she wishes to
include in the document they're printing.
Once they are done checking off what they want included, I tried creating an
Update command button on the document which, when clicked, searches which
checkboxes are checked. If unchecked, delete the whole row so it doesn't
print (that works fine). If checked, keep the statement but delete/hide only
the checkbox for printing purposes (I can't get this to work). This is the
code I tried for the first checkbox:
Private Sub cmdUpdate_Click()
' If checkbox not checked, go to bookmark in first row and delete entire
row
If chkBox1.Value = False Then
Selection.GoTo What:=wdGoToBookmark, Name:="Row1Text"
Selection.SelectRow
Selection.Rows.Delete
ElseIf chkBox1.Value = True Then
ActiveDocument.ToggleFormsDesign ' toggle on Design mode
Selection.GoTo What:=wdGoToBookmark, Name:="Row1Text"
Selection.Delete Unit:=wdCharacter, Count:=1 'delete Checkbox cell
contents
ActiveDocument.ToggleFormsDesign ' toggle off Design mode
End If
End Sub
Am I making this too hard? Any suggestions would be appreciated! Thanks.
Steve C