Dynamic table in word

Hajdini Bleron 1 Reputation point
2022-01-17T14:47:52.137+00:00

Hello all
I would like to hide certain lines in my Word form by checkbox.
I think this is possible with VBA, but I don't know exactly how. Ex. for understanding; I have a table with three columns and 5 rows. In each row certain tasks are listed and some of them are used only sporadically. My wish would be to be able to hide these certain tasks via checkbox.

Can anyone help me out here.
Thanks a lot
Kind regards
Bleron Hajdini

Translated with www.DeepL.com/Translator (free version)

Microsoft 365 and Office | Word | For business | Windows
Developer technologies | Visual Basic for Applications
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. John Korchok 6,126 Reputation points
    2022-01-17T18:24:58.833+00:00

    There are three kinds of checkboxes in Word: Legacy form field, ActiveX Control, and Content Control. The method to do this is different for each.

    The basic idea is that you bookmark a row, then use VBA like:

    Sub HideRow()
        ActiveDocument.Bookmarks("Row").Range.Text.Hidden = True
    End Sub
    

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.