View Single Post
 
Old 04-01-2023, 05:43 AM
gmaxey gmaxey is offline Windows 10 Office 2019
Expert
 
Join Date: May 2010
Location: Brasstown, NC
Posts: 1,617
gmaxey is just really nicegmaxey is just really nicegmaxey is just really nicegmaxey is just really nicegmaxey is just really nice
Default

So if "A" is selected and the list items change from A, B, C to A.I, A.II and A.III, what is supposed to happen to the initially selected value "A" that is displayed?


Perhaps something like this:



Code:
Private Sub Document_ContentControlOnExit(ByVal ContentControl As ContentControl, Cancel As Boolean)
Dim lngIndex As Long
  Select Case ContentControl.Title
    Case "Test"
      For lngIndex = ContentControl.DropdownListEntries.Count To 2 Step -1
         ContentControl.DropdownListEntries(lngIndex).Delete
      Next
      Select Case ContentControl.Range.Text
        Case "A"
           ContentControl.DropdownListEntries.Add "A.I", "A.I"
           ContentControl.DropdownListEntries.Add "A.II", "A.II"
           ContentControl.DropdownListEntries.Add "A.III", "A.III"
        Case "A.I"
           ContentControl.DropdownListEntries.Add "A.I.a", "A.I.a"
           ContentControl.DropdownListEntries.Add "A.I.b", "A.I.b"
           ContentControl.DropdownListEntries.Add "A.I.c", "A.I.c"
        Case "B"
           ContentControl.DropdownListEntries.Add "B.I", "B.I"
           ContentControl.DropdownListEntries.Add "B.II", "B.II"
           ContentControl.DropdownListEntries.Add "B.III", "B.III"
        Case "C"
           ContentControl.DropdownListEntries.Add "C.I", "C.I"
           ContentControl.DropdownListEntries.Add "C.II", "C.II"
           ContentControl.DropdownListEntries.Add "C.III", "C.III"
      End Select
  End Select
End Sub
__________________
Greg Maxey
Please visit my web site at http://www.gregmaxey.com/
Reply With Quote