![]() |
|
#1
|
||||
|
||||
![]() You could use a ContentControlOnExit macro in the 'ThisDocument' code module of the document or its template, coded like: Code:
Private Sub Document_ContentControlOnExit(ByVal CCtrl As ContentControl, Cancel As Boolean) Dim i As Long With CCtrl If .Title = "Master" Then If .Range.Text = "N/A" Then For i = 1 To 2 With ActiveDocument.SelectContentControlsByTitle("Slave")(i) .Type = wdContentControlText .Range.Text = "N/A" .LockContents = True End With Next Else For i = 1 To 2 With ActiveDocument.SelectContentControlsByTitle("Slave")(i) If .Type = wdContentControlText Then .LockContents = False .Range.Text = "" .Type = wdContentControlDropdownList End If End With Next End If End If End With End Sub
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#2
|
|||
|
|||
![]()
Thank you. That worked, but it gives me an error stating "Run-time error '6124': You are not allowed to edit this selection because it is protected." whenever I click out of the Master Content Control Drop Down.
Sorry for the inconvenience, I'm new with VBA so don't really know much about it. Thanks! |
#3
|
|||
|
|||
![]()
Another issue is that when I select another option (in my case the word "test") after I choose N/A it does not become re-editable is that an extra step?
|
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
![]() |
SaraO | Word VBA | 43 | 01-25-2023 04:05 PM |
Userform with Multiple Cascading Drop Down Lists Populated with External Source Data | venganewt | Word VBA | 21 | 05-16-2018 02:05 PM |
![]() |
Marvel | Word VBA | 11 | 05-14-2016 02:08 AM |
![]() |
LynnMac2016 | Word VBA | 3 | 04-06-2016 06:15 AM |
![]() |
mmmb | Word | 3 | 01-21-2016 07:08 PM |