Navigation Pane不能设置显示标题

https://msdn.microsoft.com/VBA/Word-VBA/articles/view-showheading-method-word

https://social.msdn.microsoft.com/Forums/office/en-US/4fd0157f-0d60-4dd8-bdc9-a06b5b4f2c35/word-2010-document-mapnavigation-pane?forum=worddev

只能通过下面的脚本显示文本区的指定级别的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.

I'm referring to: http://office.microsoft.com/client/helppreview14.aspx?AssetId=HV080056850&lcid=1033&NS=WINWORD%2EDEV&Version=14&tl=2&queryid=&respos=1&HelpID=vbawd10%2Echm161808488

##################################################

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

原文地址:https://www.cnblogs.com/itzxy/p/7427158.html