![]() |
#9
|
||||
|
||||
![]()
Are you sure you want to delete content based on the value in the check box? This doesn't allow for the user to change their mind or recover if they made an incorrect selection.
I would recommend you hide content rather than delete it. This gives you a more graceful method to re-instate content if the user changes their mind. Also, your logic of Checked = Delete seems counter-intuitive. Wouldn't checked mean you want that content and unchecked mean remove it? To demonstrate how I would approach this, add a tag value on a parent checkbox (eg aaa) and then select the children rows below that parent and add a bookmark using the same tagname. Note that the tag value must be a valid bookmark name. Then run this macro Code:
Sub ShowHideSubRows() Dim aCC As ContentControl For Each aCC In ActiveDocument.Range.ContentControls If ActiveDocument.Bookmarks.Exists(aCC.Tag) Then ActiveDocument.Bookmarks(aCC.Tag).Range.Font.Hidden = Not aCC.Checked End If Next aCC End Sub
__________________
Andrew Lockton Chrysalis Design, Melbourne Australia |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Auto-populate Text Field When I Click Check Boxes | LobaBlanca | Word VBA | 2 | 03-14-2019 08:10 PM |
Print documents based on boxes checked in word document | eshiffman | Word VBA | 8 | 04-05-2018 06:26 AM |
Need to create document that will auto insert text based on parameters | parisfranco | Word | 13 | 07-25-2017 03:21 PM |
Word document with check boxes | JohnW | Word | 3 | 12-01-2016 07:43 AM |
Table - Check Boxes - Create Select All | lajohn1963 | Word Tables | 2 | 09-25-2010 11:18 AM |