How to Show All Heading Styles in the Word Styles Pane Using VBA
Question details
The user needs a VBA macro solution to make all heading styles (Heading 1 through 9) visible in the Word Styles pane.

- Product
- Microsoft Word
- Device & OS
- not provided
- Scenario
- Formatting a complex document where heading styles are hidden from the Styles pane, requiring quick access to all heading levels.
- Observed behavior
- Heading styles can remain hidden in the Styles pane even when they are available in the document, requiring manual configuration or VBA to display them.
Before running macros in Word, ensure that the Developer tab is enabled in your ribbon and that your macro security settings allow the execution of trusted VBA scripts.
Use a VBA Macro to Unhide Headings in the Current Document
Run a simple macro to immediately display Headings 1 through 9 in the Styles pane of your active Word document.
In Word VBA, the Style.Visibility property operates on reverse logic. To make a style visible, you must set its Visibility property to False (meaning it is not hidden).
Open your Word document and press Alt + F11 on your keyboard to launch the Microsoft Visual Basic for Applications window.
In the VBA editor, click on 'Insert' in the top menu bar and select 'Module' to create a blank script window.
Copy and paste the following code: Sub ShowAllHeadingStylesInCurrentDoc() Dim i As Long For i = 1 To 9 ActiveDocument.Styles("Heading " & CStr(i)).Visibility = False Next i End Sub
Press F5 or click the Run button to execute the script. Close the VBA editor and check your Styles pane to see all headings displayed.

Automate Heading Visibility for All New and Opened Documents
Store the macro in your Normal template to ensure all headings are visible automatically whenever you open or create any document.
Manage Document Styles Easily with WPS Office
While VBA offers powerful customization for advanced scenarios, WPS Writer provides a highly intuitive and user-friendly interface to manage, modify, and display all heading styles effortlessly without writing any code.
- 1. Open WPS Writer: Launch WPS Office and open your text document using WPS Writer.
- 2. Access the Home Tab: Navigate to the Home tab on the main top ribbon where the quick formatting tools are located.
- 3. Open the Styles Pane: Click the small expansion arrow (Settings icon) in the bottom right corner of the Styles gallery to open the dedicated Styles and Formatting pane.
- 4. Configure Style Options: At the bottom of the Styles pane, click on the 'Options...' button to bring up the style display settings.
- 5. Show All Styles: Change the 'Select styles to show' dropdown menu to 'All styles'. Click OK to instantly reveal Headings 1 through 9 in your pane.

Frequently Asked Questions
Why does the macro use 'False' to make styles visible?
The Style.Visibility property in Word VBA relies on reverse logic. Setting it to 'False' means the style is 'not hidden', which effectively makes it visible in the Styles pane.
How do I hide a specific heading style using VBA?
To hide a style from the Styles pane, you apply the opposite logic. Set the Visibility property to 'True' (e.g., ActiveDocument.Styles("Heading 3").Visibility = True) to conceal it.
Is there an alternative to displaying all headings if it clutters my Quick Styles gallery?
Yes. Instead of forcing all 9 heading levels into your Styles pane and Quick Styles gallery, you can utilize built-in keyboard shortcuts (like Ctrl+Alt+1 for Heading 1, Ctrl+Alt+2 for Heading 2) to apply formats quickly without cluttering the interface.




