Document Editing Problems

How to Show and Hide Text by Clicking a Button in Word

Anum MushtaqAnum Mushtaq Nov 3, 2026 872 views

Question details

The user wants to display additional hidden information in a Word document only when a specific button is clicked by the reader.

How to Show and Hide Text When Clicking a Button in Word
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 you start

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.

Solution 1Recommended

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.

1
Open the VBA Editor

Open your Word document and press Alt + F11 to open the Visual Basic for Applications (VBA) editor.

2
Insert a Custom Macro

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

3
Insert the MacroButton Field

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

4
Update and Test the Field

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 a MacroButton Field to Display a Message Box
Macro Security and Sharing: Macros often trigger security warnings for recipients. Ensure your audience trusts the source of the document and knows how to enable macro content safely.
Effortless Document Formatting

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. 1. Open Your Document: Launch WPS Office and open your existing document in WPS Writer.
  2. 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. 3. Use Footnotes for References: To add a detailed footnote, navigate to the References tab and select Insert Footnote.
  4. 4. Save as DOCX: Save your file in standard .docx format to ensure layout and comment compatibility for all recipients.
Easily insert annotations, footnotes, and comments to hide extra details without coding.Full compatibility with Microsoft Word document formats (.docx, .doc).Lightweight, fast, and completely free to use for daily document editing tasks.
microsoft office alternative - wps office

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.