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. Doug Robbins - MVP - Office Apps and Services 322.1K Reputation points MVP Volunteer Moderator
    2021-03-03T01:27:26+00:00

    What do you mean by "real-time formatting"?

    0 comments No comments
  2. Anonymous
    2021-03-03T03:29:59+00:00

    Please expand on the formatting you want to do.

    Take a look at this reply to a similar question:

    https://stackoverflow.com/questions/45711329/conditional-formatting-in-microsoft-word-2016-table-cells

    Point 4 means you create your table in Excel, with conditional formatting. You copy the area in Excel and Paste special it into Word as an excel object. You can enter data in the "excel" table embedded in Word, Excel will handle the conditional formatting.

    0 comments No comments
  3. Anonymous
    2021-03-03T03:35:25+00:00

    What do you mean by "real-time formatting"?

    When the checkbox is clicked, it instantly colors the cell.

    I was able to find macros that you run that will color the cells checked but you have to run it after the fact

    0 comments No comments
  4. Anonymous
    2021-03-03T03:40:07+00:00

    Please expand on the formatting you want to do.

    Take a look at this reply to a similar question:

    https://stackoverflow.com/questions/45711329/conditional-formatting-in-microsoft-word-2016-table-cells

    Point 4 means you create your table in Excel, with conditional formatting. You copy the area in Excel and Paste special it into Word as an excel object. You can enter data in the "excel" table embedded in Word, Excel will handle the conditional formatting.

    I just tested Point 4. It copies the table over but with odd formatting. Also, the conditional formatting does not carry over into word. The person is saying to do all the "checking" in excel and copying the final results into Word.

    0 comments No comments