How to hide and unhide different tables in Microsoft Word 2013?

Hello Team,

I have a MS Word 2013 document that should be used by teams "A" and "B"
In the first section of the document we have a couple of questions with dropdown options where the users will choose which team they belong to.
If Team "A" is selected then we would show one specific table to be completed
If Team B then another table appears.
So, how can I make it?
How to hide and unhide those two different tables?

If you put a bookmark such as A and B in each of the tables, you could use code such as the following to hide the respective table

ActiveDocument.Bookmarks("A").Range.Tables(1).Range.Font.Hidden = True

However, as that requires that Hidden Text not be displayed and that being a user selected option, it may not be effective.

Alternatively, you could use code such as the following to delete the appropriate table

ActiveDocument.Bookmarks("A").Range.Tables(1).Delete

Hope this helps,
Doug Robbins - MVP Office Apps & Services (Word)
dougrobbinsmvp@gmail.com
It's time to replace ‘Diversity, Equity & Inclusion’ with ‘Excellence, Opportunity & Civility’ - V Ramaswamy

Was this reply helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

Doug, tks!

where should I use the code you mentioned, since it's going to be customer selection in a dropdown?

and what should be used in the drop-down (any code should be added there also)?

PAGE 1 - COVER

PAGE 2 - USER CLICK A DROP-DOWN ADN SELECT "A" OR "B"

PAGE 3 - THE SELECTED TABLE IS SHOWN (at this moment, I have both tables there)

1 person found this reply helpful

·

Was this reply helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

I believe that will only hide the text in the table, and not the table itself. 
Ted Tschopp

Was this reply helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

I believe that will only hide the text in the table, and not the table itself. 

Selecting the whole table and formatting it as hidden will actually hide the table from view (assuming of course that you have set Word not to display or print hidden text). Similarly, you can hide one or more whole rows, and those will be invisible. Note, however, that hiding content in a column will not hide the whole column.

Stefan Blom
Microsoft 365 Word MVP since 2005
Volunteer Moderator (Office)
MS 365, Win 11 Pro
~~~~
Please note that I do not work for Microsoft
MVP program info: https://mvp.microsoft.com/
~~~~

8 people found this reply helpful

·

Was this reply helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

 
 

Question Info


Last updated April 15, 2024 Views 14,064 Applies to: