C
coginthemachine
I am trying to cut certain sections of text based on their Checkbox value (if
Chekcbox.Value=False, delete the section up to the next CheckBox). The code
(graciously donated by Dian Chapman) works great and steps through each
Checkbox as expected. However, each time I use a Selection command (either
MoveStart or MoveEnd) it always starts wherever the cursor was when I ran the
macro. I need to set the Selection Start at each Checkbox in the For Loop as
it processes.
Here is the code I am working on:
Dim fld as FormField
For each fld in ActiveDocument.FormFields
If fld.CheckBox.Value = false then
?? Start selection at current Checkbox
?? moveselection end to next checkbox
delete section
Else
; Do nothing, checkbox checked (true) means keep the section
End if
Next fld
Can anyone give me some direction on how to do this? I appreciate it.
Chekcbox.Value=False, delete the section up to the next CheckBox). The code
(graciously donated by Dian Chapman) works great and steps through each
Checkbox as expected. However, each time I use a Selection command (either
MoveStart or MoveEnd) it always starts wherever the cursor was when I ran the
macro. I need to set the Selection Start at each Checkbox in the For Loop as
it processes.
Here is the code I am working on:
Dim fld as FormField
For each fld in ActiveDocument.FormFields
If fld.CheckBox.Value = false then
?? Start selection at current Checkbox
?? moveselection end to next checkbox
delete section
Else
; Do nothing, checkbox checked (true) means keep the section
End if
Next fld
Can anyone give me some direction on how to do this? I appreciate it.