I have a Word document (aaa.docm) that contains two content controls. The first is a drop-down list content control (Title: CCDDL) with the selections "No issues" and "Issues found". The second is a text box content control (Title: CCTB) to be used to describe the "Issue". I would like the Content Control Text Box to disappear if "No issues" is selected from the drop-down list. When I use the below VB code, the Content Control Text Box will disappear if I select "No Issue" but it will not reappear if I select "Issues found". What am i doing wrong?
Sub UpdateTextBoxVisibility()
Dim ddValue As String
ddValue = ActiveDocument.SelectContentControlsByTitle("CDDL")(1).DropdownListEntries(1).Value
If ddValue = "No issues" Then
ActiveDocument.SelectContentControlsByTitle("CCTB")(1).Range.Font.Hidden = True
Else
ActiveDocument.SelectContentControlsByTitle("CCTB")(1).Range.Font.Hidden = False
End If
End Sub
Thanks for your help!