View Single Post
 
Old 04-07-2022, 11:57 PM
macropod's Avatar
macropod macropod is offline Windows 10 Office 2016
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,963
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Presumably, you want something like:
Code:
Option Explicit
Dim StrOption As String

Private Sub Document_ContentControlOnEnter(ByVal CCtrl As ContentControl)
With CCtrl
  Select Case .Title
    Case "Spouse1", "Spouse2": StrOption = .Range.Text
  End Select
End With
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
  Select Case .Title
    Case "Spouse1", "Spouse2"
      With CCtrl
        Select Case .Range.Text
          Case StrOption: Exit Sub
          Case "Yes"
            StrOut = "Spouse is able and available," & _
              "Spouse is able and partially available," & _
              "Spouse is able but not available," & _
              "Spouse is available but not able," & _
              "Spouse is IHSS Recipient," & _
              "Other"
          Case "No": StrOut = "N/A"
        End Select
      End With
      With ActiveDocument.SelectContentControlsByTitle("A&A")(1)
        .DropdownListEntries.Clear
        .Type = wdContentControlText
        .Range.Text = ""
        .Type = wdContentControlDropdownList
        For i = 0 To UBound(Split(StrOut, ","))
          .DropdownListEntries.Add Split(StrOut, ",")(i)
        Next
      End With
  End Select
End With
Application.ScreenUpdating = True
End Sub
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote