View Single Post
 
Old 09-14-2020, 07:18 AM
Guessed's Avatar
Guessed Guessed is offline Windows 10 Office 2016
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 4,176
Guessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant future
Default

Replace the code in the ThisDocument module with this
Code:
Private Sub Document_ContentControlOnExit(ByVal myCC As ContentControl, Cancel As Boolean)
  Dim aCC As ContentControl, strSet As String
  If myCC.Title = "EmploymentType" Then
    strSet = myCC.Range.Text
    For Each aCC In ActiveDocument.ContentControls
      If aCC.Title <> "EmploymentType" Then
        aCC.Range.Font.Hidden = aCC.Title <> strSet  'hide if CC title doesn't match selected employment type
      End If
    Next aCC
  End If
  ActiveWindow.View.ShowAll = False
  ActiveWindow.View.ShowHiddenText = False
End Sub
Attached Files
File Type: dotm Test.dotm (27.3 KB, 8 views)
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
Reply With Quote