![]() |
|
#4
|
||||
|
||||
|
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 |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
Can you hide a comment in word using vba?
|
mrlemmer11 | Word VBA | 1 | 07-05-2015 03:23 PM |
| How to Hide/Un-hide a worksheet based on cell on another sheet. | easton11 | Excel Programming | 1 | 06-02-2015 12:07 PM |
| Inserts a checkmark when click on a cell | imfloyd | Excel | 3 | 01-17-2015 04:52 AM |
| Hide cursor in Word file | Cosmo | Word | 1 | 10-26-2012 02:46 PM |
| Checkmark function problem | todddesignr | PowerPoint | 0 | 07-29-2011 07:40 AM |