Office Settings & Configuration

How to Show All Heading Styles in the Word Styles Pane Using VBA

Rana GarciaRana Garcia Oct 26, 2026 870 views

Question details

The user needs a VBA macro solution to make all heading styles (Heading 1 through 9) visible in the Word Styles pane.

How to Show All Heading Styles in the Word Styles Pane Using VBA
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 you start

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.

Solution 1Recommended

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).

1
Open the VBA Editor

Open your Word document and press Alt + F11 on your keyboard to launch the Microsoft Visual Basic for Applications window.

2
Insert a New Module

In the VBA editor, click on 'Insert' in the top menu bar and select 'Module' to create a blank script window.

3
Paste the Macro Code

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

4
Run the Macro

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.

Use a VBA Macro to Unhide Headings in the Current Document
Quick Tip: If you only see Headings 1 and 2 by default, this macro will instantly populate the list with the remaining heading levels without manual menu clicking.

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. 1. Open WPS Writer: Launch WPS Office and open your text document using WPS Writer.
  2. 2. Access the Home Tab: Navigate to the Home tab on the main top ribbon where the quick formatting tools are located.
  3. 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. 4. Configure Style Options: At the bottom of the Styles pane, click on the 'Options...' button to bring up the style display settings.
  5. 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.
Fully compatible with Microsoft Word .doc and .docx formatsBuilt-in intuitive Styles pane for effortless formattingFree and lightweight office suite with familiar UIAdvanced style management without the need for complex VBA macros
QA img-9

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.