View Single Post
 
Old 02-21-2021, 03:09 PM
Guessed's Avatar
Guessed Guessed is online now 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

Select each line that is correct and insert a Plain Text Content Control around it. You don't want the "- correct" text in your example.

Then run this macro. I've set it up to toggle so running it alternates showing or hiding the correct answers.
Code:
Sub ToggleAnswers()
  Dim aCC As ContentControl, iColor As Long, iShowCC As Integer
  If ActiveDocument.ContentControls(1).Range.Font.ColorIndex = wdBlack Then
    iColor = wdGreen
    iShowCC = wdContentControlBoundingBox
  Else
    iColor = wdBlack
    iShowCC = wdContentControlHidden
  End If
  For Each aCC In ActiveDocument.ContentControls
    With aCC.Range.Paragraphs(1).Range.Font
      .ColorIndex = iColor
      .Bold = .ColorIndex = wdGreen
      aCC.Appearance = iShowCC
    End With
  Next aCC
End Sub
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
Reply With Quote