Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #4  
Old 02-21-2021, 03:09 PM
Guessed's Avatar
Guessed Guessed is offline Hide checkmark and the word following it Windows 10 Hide checkmark and the word following it Office 2016
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 4,184
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
 



Similar Threads
Thread Thread Starter Forum Replies Last Post
Hide checkmark and the word following it 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

Other Forums: Access Forums

All times are GMT -7. The time now is 10:25 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft