#1
|
|||
|
|||
Delete rows using checkbox in word
In 05-04-2014 I've posted a New Thread to help me create a macro to Delete the rows of the unchecked checkboxs.
The post is: https://www.msofficeforums.com/word-...e-answers.html However instead of using checkbox Content Control is it possible to do the same thing with the Check Box ActiveX Control? I attach a sample document for analysis. Anyone can help me on this? Thanks Jorge Vieira |
#2
|
||||
|
||||
Yes, it's possible, but your ActiveX checkboxes aren't in a table anyway, so it's not clear what you're trying to achieve, aside from perhaps deleting them. If they're for use in a table, I also don't see that you'll have gained anything by changing to ActiveX checkboxes.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#3
|
|||
|
|||
Your right. I forgot to put the ActiveX checkboxes in a table. I attach a new sample document.
Changing to ActiveX checkboxes, I noticed later that it would be more useful for me in terms of usability and creation of selection dependencies. I apreciate your help if you could do something about it, Paul. Thks |
#4
|
||||
|
||||
before you go down that path, see: http://office.microsoft.com/en-us/wo...010031067.aspx
Quote:
Code:
Sub Demo() Application.ScreenUpdating = False Dim i As Long, Pwd As String, pState As Variant With ActiveDocument If .ProtectionType <> wdNoProtection Then Pwd = InputBox("Please enter the Password", "Password") pState = .ProtectionType .Unprotect Pwd End If With .Tables(1).Range For i = .Rows.Count To 1 Step -1 With .Rows(i) If .Range.InlineShapes.Count = 1 Then If .Range.InlineShapes(1).Type = wdInlineShapeOLEControlObject Then If InStr(.Range.InlineShapes(1).OLEFormat.ClassType, "CheckBox") > 0 Then If .Range.InlineShapes(1).OLEFormat.Object = False Then .Delete End If End If End If End If End With Next End With If pState <> wdNoProtection Then .Protect Type:=pState, NoReset:=True, Password:=Pwd End With Application.ScreenUpdating = True End Sub
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#5
|
|||
|
|||
So you think is more easy using content controls? Ok I follow your advice because i'me not very confortable on this matter.
But in that case can you hep me in another think please: How can I create dependency selection using content controls? For example,in the sample document attached, i want: - if option 1 is selected automatically option 2 is also selected - if option 1 is unselected automatically option 2 will be also unselecteded - if option 3 is selected than option 4 cannot be selected Thks |
#6
|
||||
|
||||
If Option 2 is tied to option 1, why do you have option 2? It seems rather pointless making it a separate option if it can't be chosen in its own right. As for having exclusive options, see, for example: https://www.msofficeforums.com/word-...html#post33489
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Macro to delete all empty rows from all tables | braddgood | Word VBA | 15 | 10-02-2015 01:54 PM |
Find and Delete Rows | damaniam | Word VBA | 1 | 03-11-2014 06:54 AM |
Word Macro to find and delete rows that contain adjacent cells containing "." | AlexanderJohnWilley | Word VBA | 7 | 11-08-2012 10:15 AM |
Delete all rows but the last. | elky1967 | Word VBA | 14 | 09-21-2012 05:27 AM |
Macro to conditionally delete rows | Steve_D | Excel | 2 | 08-24-2012 09:37 PM |