Microsoft Office Forums

Go Back   Microsoft Office Forums > Microsoft Word > Word Tables

Reply
 
LinkBack Thread Tools Display Modes
  #1  
Old 07-11-2016, 03:59 PM
CarlCR CarlCR is offline Windows 10 Office 2007
Novice
 
Join Date: Jul 2016
Posts: 4
CarlCR is on a distinguished road
Smile How to make a Check Box Form Field red if not checked?

I have a Word Table doc with a check box on each row to track what has been accomplished. Is there a way to make a Check Box red if it has not been checked and then to turn black after it is checked?
Reply With Quote
  #2  
Old 07-11-2016, 11:56 PM
gmayor's Avatar
gmayor gmayor is offline Windows 10 Office 2016
Expert
 
Join Date: Aug 2014
Posts: 2,702
gmayor is just really nicegmayor is just really nicegmayor is just really nicegmayor is just really nice
Default

I assume we must be talking about legacy form fields, in which case you will need a macro run on exit from the checkbox field and you would have to leave the field to run it e.g.

Code:
Sub MacroOnExit()
    If GetCurrentFF.CheckBox.Value = True Then
        GetCurrentFF.Range.Font.ColorIndex = wdAuto
    Else
        GetCurrentFF.Range.Font.ColorIndex = wdRed
    End If
lbl_Exit:
    Exit Sub
End Sub

Private Function GetCurrentFF() As Word.FormField
    Set rngFF = Selection.Range.FormFields(1).Range
    Set GetCurrentFF = rngFF.FormFields(1)
lbl_Exit:
    Exit Function
End Function
__________________
Graham Mayor - MS MVP (Word)
Visit my web site for more programming tips and ready made processes www.gmayor.com
Reply With Quote
  #3  
Old 07-12-2016, 05:56 AM
CarlCR CarlCR is offline Windows 10 Office 2007
Novice
 
Join Date: Jul 2016
Posts: 4
CarlCR is on a distinguished road
Question What is the Private Function

Thank you Graham. What does the Private Function do? It seems to be a separate macro.
Reply With Quote
  #4  
Old 07-12-2016, 08:35 PM
gmayor's Avatar
gmayor gmayor is offline Windows 10 Office 2016
Expert
 
Join Date: Aug 2014
Posts: 2,702
gmayor is just really nicegmayor is just really nicegmayor is just really nicegmayor is just really nice
Default

It identifies the current field to the main macro, so that you don't have to create a separate macro for each check box field.
__________________
Graham Mayor - MS MVP (Word)
Visit my web site for more programming tips and ready made processes www.gmayor.com
Reply With Quote
Reply

Tags
check box, colors, table

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Grammar check into legacy forms > Text form field. Eduardo Care Word 2 09-09-2015 03:11 PM
Check box form field automatically checked Eduardo Care Word 8 09-07-2015 03:31 PM
Check Box Form Field Book Mark Auto Fill? zacam87 Word VBA 5 08-20-2014 02:56 PM
Repeat Spell check in a doc that has already been checked mawigfie Word 1 08-22-2012 01:16 PM
Word Macro That Checks a Check Box Form Field When File Print is Executed DKerne Word VBA 4 06-09-2011 11:54 AM


All times are GMT -7. The time now is 02:12 PM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
MSOfficeForums.com is not affiliated with Microsoft