![]() |
#1
|
|||
|
|||
![]()
Hi
When I modified the defined list in "Master" and "Slave" list in https://www.msofficeforums.com/word-...down-list.html to include about 9 options and associated 1 to 9 different slave options, the drop down list is not working anymore. Can you please help? I pasting what I did: Code:
Option Explicit Dim StrOption As String Private Sub Document_ContentControlOnEnter(ByVal CCtrl As ContentControl) If CCtrl.Title = "Master" Then StrOption = CCtrl.Range.Text End Sub Private Sub Document_ContentControlOnExit(ByVal CCtrl As ContentControl, Cancel As Boolean) Application.ScreenUpdating = False Dim i As Long, StrOut As String With CCtrl If .Title = "Master" Then If StrOption = .Range.Text Then Exit Sub Select Case .Range.Text Case "Design" StrOut = "Inadequate Design,Incorrect design methodology" Case "Communication" StrOut = "No communication,Ineffective communication,Wrong message provided,Misunderstanding/misinterpreting message,Lack of/Awaiting on required information" Case "Plant and Equipment" StrOut = "Wrong plant/equipment used,Non compatible plant/equipment used" Case "Planning" StrOut = "Inadequate resource planning,Inadequate scope planning,Inadequate time planning" Case "Error/Violation" StrOut = "Poor workmanship,Non-compliance with plant/equipment's O&MM recommendations,Lack of supervision,Non-compliance with work methodology,Non-compliance with specification/acceptance criteria,Non-compliance with documented procedure/process,Unexpected Machine/Equipment Operational Failure,Operator Error,Operator lack of experience/competency/skill" Case "Materials Availability and Suitability or Quality of Material" StrOut = "Using non-approved material,Poor quality material,Defective material used" Case "Congestion/Restriction/Access" StrOut = "Inadequate space,Restrictions in place,Inadequate access" Case "ITP/Process Control" StrOut = "Lack of adoption of ITP control,Non-compliance with an ITP control" Case "Abnormal operational situation/condition" StrOut = "Inclement Weather Condition" Case "Document Control Management" StrOut = "Using superseded document,Non-availability of IFU document" Case "Subcontractor Management" StrOut = "Requirement not communicated to subcontractor,Lack of supervision on site" Case Else .Type = wdContentControlText .Range.Text = "" .Type = wdContentControlDropdownList End Select With ActiveDocument.SelectContentControlsByTitle("Slave")(1) .DropdownListEntries.Clear For i = 0 To UBound(Split(StrOut, ",")) .DropdownListEntries.Add Split(StrOut, ",")(i) Next .Type = wdContentControlText .Range.Text = "" .Type = wdContentControlDropdownList End With End If End With Application.ScreenUpdating = True End Sub Last edited by macropod; 06-10-2019 at 09:48 PM. Reason: Added code tags |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
![]() |
SaraO | Word VBA | 43 | 01-25-2023 04:05 PM |
The same cascading dropdown lists several times in a document | al9512 | Word VBA | 1 | 08-10-2018 04:42 AM |
![]() |
Inger70 | Word VBA | 2 | 08-10-2018 04:41 AM |
![]() |
TheSwede | Excel | 3 | 04-02-2017 01:27 PM |
![]() |
music_al | Word VBA | 6 | 02-15-2016 03:56 PM |