Word – How to add custom styles to navigation pane or change them with VBA

microsoft wordmicrosoft-word-2010vba

I have a Word2010 document that was created by a tool from Axure.

  • Each heading is formated with a custom style ("AxureHeading1", "AxureHeading2", "AxureHeading3").
  • I was able to create a table of contents with the custom made headings: References tab, click Table of Contents, click Insert Table of Contents, and then click Options. Under Available styles.
  • But i am unable to figure out what i need to do to include these custom headings in the navigation pane

What can i do to either

  1. change every custom heading (level 1, 2, 3) with the inbuild headings from word without clicking and selecting each heading manually (VBA Macro?)
  2. or adjust the custom heading style so that it will show up in the navigaton pane

An image of the navigation pane that shows the inbuild headings
Navigaton Pane in Word 2010

Update

It seems that my macro approach works (option 1). But if anybody knows a way for option 2 i would still be interested to hear about it.

Best Answer

VBA isn't required.

In the modify style dialog select FORMAT - PARAGRAPH and change the OUTLINE LEVEL from Body Text to the Outline Level you want.

This will add all the headings with that style to the document document outline shown in the Navigation Pane.

Related Question