https://msdn.microsoft.com/VBA/Word-VBA/articles/view-showheading-method-word
只能通过下面的脚本显示文本区的指定级别的heading ,不能改变导航区的显示标题级别!
Hi Radderz,
The behavior changes since Word 2010. In Word 2010 we are able to show heading to specified level, but this is restriced in Outline view or Master view. Below code can control heading in above two views,
but could not control heading in document navigation pane.
Private Sub Document_Open() With ActiveDocument.ActiveWindow.View .Type = wdMasterView .ShowHeading 2 End With End Sub
Hope this gets you in the right direction.
##################################################
http://www.msofficeforums.com/word-vba/20575-navigation-pane-show-heading-level-x-only.html
Hi to all,
unfortunately in Word 2010 Navigation pane is fully expanded whenever I open it. Of course right-clicking in the pane I can set the heading level to whatever level, but the setting (obvioulsy) isn‘t saved.
In 2003 two simple code lines in an _Open macro fixed the problem:
Code:
ActiveWindow.View.ShowHeading x ActiveWindow.DocumentMap = True
But with 2010 this code doesn‘t work anymore. Whatever ShowHeading level I try, Navigation pane always shows default ‘3‘. The code doesn‘t throw any error nor does it work - it is simply ignored.
Any ideas how to make the Navigation pane show only the specified heading level?
Thanks
NP