How to Show and Hide Text by Clicking a Button in Word
Question details
The user wants to display additional hidden information in a Word document only when a specific button is clicked by the reader.

- Product
- Microsoft Word
- Device & OS
- not provided
- Scenario
- Creating interactive documents, forms, or study guides where supplementary information is kept hidden to save space and only revealed upon user interaction.
- Observed behavior
- Word does not offer a native, simple 'button to toggle text' feature without programming, requiring users to rely on MacroButton fields or alternative built-in formatting options.
Before proceeding, determine whether the document recipients will be able to enable macros, as macro-based buttons pose security warnings. If macros are restricted by your organization or recipients, you should use safer built-in alternatives like comments or collapsible headings.
Use a MacroButton Field to Display a Message Box
Create a clickable field that runs a custom VBA macro to display the hidden text in a pop-up window.
This method requires saving the file as a Macro-Enabled Document (*.docm). The recipients must click 'Enable Content' to allow the macro to run when they open the file.
Open your Word document and press Alt + F11 to open the Visual Basic for Applications (VBA) editor.
Go to Insert > Module in the top menu. In the code window, write a simple macro. For example: Sub ShowMessage() MsgBox "Here is the additional information you requested." End Sub
Return to your Word document. Place your cursor where you want the button, press Ctrl + F9 to insert field braces, and type: MACROBUTTON ShowMessage Click Here to Read More
Press F9 to update the field. It will now display as text. Double-clicking this text will trigger the macro and display your hidden message.

Use Collapsible Headings for Interactive Expanding Text
A safer, macro-free method to hide large chunks of text under a heading that expands when clicked.
Add Hidden Details Using Comments or Footnotes
Use native Word features to embed additional information without cluttering the main text, avoiding macro security issues entirely.
Create Interactive Documents Easily in WPS Writer
WPS Writer offers intuitive built-in tools like Comments, Footnotes, and outlining to hide or annotate additional information seamlessly—without relying on complex VBA macros. It provides a lightweight, fast, and familiar interface for all your document needs.
- 1. Open Your Document: Launch WPS Office and open your existing document in WPS Writer.
- 2. Add Comments for Hidden Info: Highlight the text you want to annotate, go to the Insert tab on the top ribbon, and click Comment to attach hidden details.
- 3. Use Footnotes for References: To add a detailed footnote, navigate to the References tab and select Insert Footnote.
- 4. Save as DOCX: Save your file in standard .docx format to ensure layout and comment compatibility for all recipients.

Frequently Asked Questions
Why isn't my MacroButton working when I click it?
By default, Word requires you to double-click a MacroButton field to execute the macro. To make it work with a single click, you would need to adjust your Word settings or map a hyperlink to the macro, which requires more advanced VBA.
Can I hide text inside a text box and show it upon clicking?
Word does not natively support triggering visibility changes for shapes or text boxes via clicks without writing complex VBA programming. Using collapsible headings or comments are much simpler and safer alternatives.
Will collapsed headings stay hidden when I print the document?
By default, Word prints the entire document, including text hidden under collapsed headings. To exclude text from printing, you must manually format the text as 'Hidden' in the Font settings and ensure 'Print hidden text' is unchecked in your Word Options.
How do I format text as hidden without using a button?
Select the text you want to hide, press Ctrl + D to open the Font dialog box, check the 'Hidden' option, and click OK. You can toggle the visibility of this hidden text on your screen by clicking the Show/Hide ¶ button on the Home tab.




