Real-time MS Word table formatting based on checkbox

Anonymous
2021-03-03T01:17:42+00:00

Hello

I'm trying to find a way to do real-time formatting on a table when a checkbox is selected. I'm trying to make an interactive checklist. As the user completes a step, they will check the box. Excel would probably be easier but this will be located in a Operator's Manual that will be a Word doc. Please advise

Update: By "real time formatting", I want the row to highlight automatically when the checkbox is clicked. 

Microsoft 365 and Office | Word | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments
{count} votes
Answer accepted by question author
  1. Doug Robbins - MVP - Office Apps and Services 322.1K Reputation points MVP Volunteer Moderator
    2021-03-03T07:32:13+00:00

    If you are using ContentControl Checkboxes and you assign the title Check to each of them, if you have the following code in the ThisDocument object, the rows will be shaded as you want

    Private Sub Document_ContentControlOnExit(ByVal ContentControl As ContentControl, Cancel As Boolean)

    If ContentControl.Title = "Check" Then

    If ContentControl.Checked = True Then
    
        ContentControl.Range.Rows(1).Shading.BackgroundPatternColor = wdColorYellow
    
    Else
    
        ContentControl.Range.Rows(1).Shading.BackgroundPatternColor = wdColorWhite
    
    End If
    

    End If

    End Sub

    1 person found this answer helpful.
    0 comments No comments

5 additional answers

Sort by: Most helpful
  1. Anonymous
    2021-03-03T12:13:22+00:00
    • Create your "table" in Excel.
    • Apply your conditional formatting
    • Select the table in Excel (If you plan to add data, you have to select blank rows. The selection you paste into Word will NOT expand with the data in Excel)
    • Copy
    • Switch to Word
    • Paste Special > "Paste Link:" and "Microsoft Excel Worksheet Object"
    • when you want to change the data in the table, double click on it, Excel loads with the selection displayed, make your changes. They will be reflected in Word

    .

    I've tested, it works for me. I see the data in Word displayed as a table. When I have Excel open and make a change in Excel, it is displayed in Word in "real time".

    .

    0 comments No comments